Instantly share code, notes, and snippets.

View nginx.conf
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.
View gist:c3c3b4175196f3401523484aca424c85
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
View TestCase.php
<?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
*/
View notification.js
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') {
View dev4g.com.tw.conf
server {
listen 80;
listen [::]:80;
server_name www.dev4g.com.tw;
return 301 https://$server_name$request_uri;
}
server {
View project.dev.conf
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;
View superclass.md

Closure function

Test.php

Class Test extends AbstractTest {

	public function calculateFee(array $weightArray, int $amount) : int
	{
        	$weights = $this->arrayToCollection($weightArray);
View routes-web.php
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');
View routes-api.php
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These