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
// Login middleware | |
Route::group(['middleware' => 'login'], function () { | |
Route::post('login', function () { | |
// 使用 Login 中介層 | |
}); | |
}); |
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\Http; | |
use Illuminate\Foundation\Http\Kernel as HttpKernel; | |
class Kernel extends HttpKernel | |
{ | |
/** | |
* The application's global HTTP middleware stack. | |
* | |
* @var array | |
*/ |
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\Http\Middleware\Login; | |
use Closure; | |
use Carbon; | |
use Maras0830\Repository\LogsRepository; | |
class InsertLogs | |
{ |
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\Events; | |
use App\Events\Event; | |
use Illuminate\Queue\SerializesModels; | |
use Illuminate\Http\Request; | |
class MemberLoginEvent extends Event { | |
use SerializesModels; | |
public $request; | |
/** |
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\Handlers\Events; | |
use App\Events\MemberLoginEvent; | |
use Illuminate\Queue\InteractsWithQueue; | |
use Illuminate\Contracts\Queue\ShouldBeQueued; | |
use Maras\Contracts\LogsRepositoryInterface; | |
class MemberLoginEventHandler { | |
protected $logsRepository; | |
/** |
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\Contracts\Events\Dispatcher as DispatcherContract; | |
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; | |
class EventServiceProvider extends ServiceProvider | |
{ | |
/** |
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\Contracts\Events\Dispatcher as DispatcherContract; | |
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; | |
class EventServiceProvider extends ServiceProvider | |
{ | |
/** | |
* The event listener mappings for the application. | |
* | |
* @var array |
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\Handlers\Events; | |
use App\Events\MemberLoginEvent; | |
use Maras\Contracts\LogsRepositoryInterface; | |
use Auth; | |
use Carbon\Carbon; | |
class MemberLoginEventHandler | |
{ | |
protected $logsRepository; | |
/** |
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\Http\Controllers; | |
use Auth; | |
use Illuminate\Routing\Controller; | |
use Maras\Contracts\LogsRepositoryInterface; | |
class AuthController extends Controller | |
{ | |
protected $logsRepository; | |
/** |
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
'pusher' => [ | |
'driver' => 'pusher', | |
'key' => env('PUSHER_KEY'), | |
'secret' => env('PUSHER_SECRET'), | |
'app_id' => env('PUSHER_APP_ID'), | |
'options' => [ | |
'host' => 'api-ap1.pusher.com', // if pusher/pusher-php-server < 2.4.1. | |
'cluster' => 'ap1' // require: pusher/pusher-php-server: ~2.4.1 | |
], | |
], |
OlderNewer