Class Test extends AbstractTest {
public function calculateFee(array $weightArray, int $amount) : int
{
$weights = $this->arrayToCollection($weightArray);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
root /var/www/Service/laravel_datacenter_api/public/; | |
server_name api.4gamers.dev; | |
index index.php index.html index.htm; | |
# resource v0,v1 api. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Bootstrap any application services. | |
* | |
* @return void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'api' => [ | |
'driver' => 'passport', | |
'provider' => 'users' | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Artisan; | |
abstract class TestCase extends Illuminate\Foundation\Testing\TestCase | |
{ | |
/** | |
* The base URL to use while testing the application. | |
* | |
* @var string | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var socket_lottery_io = io.connect(location.origin + ':3033'); | |
socket_lottery_io.on('lotteryNotification', function(data) { | |
setLotteryNotification(data); | |
}); | |
function setLotteryNotification(data) { | |
Notification.requestPermission(function(status) { | |
if (status === 'granted') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name www.dev4g.com.tw; | |
return 301 https://$server_name$request_uri; | |
} | |
server { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name test.dev; | |
root /var/www/project1/public; | |
index index.php index.html index.htm; | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route::group(['prefix' => '/user', 'middleware' => 'auth:api'], function (){ | |
Route::get('/', function (Request $request) { | |
return $request->user(); | |
}); | |
Route::get('/facebook_information', function (Request $request) { | |
return "Hello " . $request->user()->name . " got Facebook information!"; | |
})->middleware('scope:Facebook_information'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Http\Request; | |
/* | |
|-------------------------------------------------------------------------- | |
| API Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register API routes for your application. These |
NewerOlder