@@ -6,55 +6,55 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Kernel extends HttpKernel |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * The application's global HTTP middleware stack. |
|
| 11 | - * |
|
| 12 | - * These middleware are run during every request to your application. |
|
| 13 | - * |
|
| 14 | - * @var array |
|
| 15 | - */ |
|
| 16 | - protected $middleware = [ |
|
| 17 | - \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, |
|
| 18 | - \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, |
|
| 19 | - \PiFinder\Http\Middleware\TrimStrings::class, |
|
| 20 | - \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, |
|
| 21 | - ]; |
|
| 9 | + /** |
|
| 10 | + * The application's global HTTP middleware stack. |
|
| 11 | + * |
|
| 12 | + * These middleware are run during every request to your application. |
|
| 13 | + * |
|
| 14 | + * @var array |
|
| 15 | + */ |
|
| 16 | + protected $middleware = [ |
|
| 17 | + \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, |
|
| 18 | + \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, |
|
| 19 | + \PiFinder\Http\Middleware\TrimStrings::class, |
|
| 20 | + \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, |
|
| 21 | + ]; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * The application's route middleware groups. |
|
| 25 | - * |
|
| 26 | - * @var array |
|
| 27 | - */ |
|
| 28 | - protected $middlewareGroups = [ |
|
| 29 | - 'web' => [ |
|
| 30 | - \PiFinder\Http\Middleware\EncryptCookies::class, |
|
| 31 | - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, |
|
| 32 | - \Illuminate\Session\Middleware\StartSession::class, |
|
| 33 | - // \Illuminate\Session\Middleware\AuthenticateSession::class, |
|
| 34 | - \Illuminate\View\Middleware\ShareErrorsFromSession::class, |
|
| 35 | - \PiFinder\Http\Middleware\VerifyCsrfToken::class, |
|
| 36 | - \Illuminate\Routing\Middleware\SubstituteBindings::class, |
|
| 37 | - ], |
|
| 23 | + /** |
|
| 24 | + * The application's route middleware groups. |
|
| 25 | + * |
|
| 26 | + * @var array |
|
| 27 | + */ |
|
| 28 | + protected $middlewareGroups = [ |
|
| 29 | + 'web' => [ |
|
| 30 | + \PiFinder\Http\Middleware\EncryptCookies::class, |
|
| 31 | + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, |
|
| 32 | + \Illuminate\Session\Middleware\StartSession::class, |
|
| 33 | + // \Illuminate\Session\Middleware\AuthenticateSession::class, |
|
| 34 | + \Illuminate\View\Middleware\ShareErrorsFromSession::class, |
|
| 35 | + \PiFinder\Http\Middleware\VerifyCsrfToken::class, |
|
| 36 | + \Illuminate\Routing\Middleware\SubstituteBindings::class, |
|
| 37 | + ], |
|
| 38 | 38 | |
| 39 | - 'api' => [ |
|
| 40 | - 'throttle:60,1', |
|
| 41 | - 'bindings', |
|
| 42 | - ], |
|
| 43 | - ]; |
|
| 39 | + 'api' => [ |
|
| 40 | + 'throttle:60,1', |
|
| 41 | + 'bindings', |
|
| 42 | + ], |
|
| 43 | + ]; |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * The application's route middleware. |
|
| 47 | - * |
|
| 48 | - * These middleware may be assigned to groups or used individually. |
|
| 49 | - * |
|
| 50 | - * @var array |
|
| 51 | - */ |
|
| 52 | - protected $routeMiddleware = [ |
|
| 53 | - 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, |
|
| 54 | - 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, |
|
| 55 | - 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, |
|
| 56 | - 'can' => \Illuminate\Auth\Middleware\Authorize::class, |
|
| 57 | - 'guest' => \PiFinder\Http\Middleware\RedirectIfAuthenticated::class, |
|
| 58 | - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, |
|
| 59 | - ]; |
|
| 45 | + /** |
|
| 46 | + * The application's route middleware. |
|
| 47 | + * |
|
| 48 | + * These middleware may be assigned to groups or used individually. |
|
| 49 | + * |
|
| 50 | + * @var array |
|
| 51 | + */ |
|
| 52 | + protected $routeMiddleware = [ |
|
| 53 | + 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, |
|
| 54 | + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, |
|
| 55 | + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, |
|
| 56 | + 'can' => \Illuminate\Auth\Middleware\Authorize::class, |
|
| 57 | + 'guest' => \PiFinder\Http\Middleware\RedirectIfAuthenticated::class, |
|
| 58 | + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, |
|
| 59 | + ]; |
|
| 60 | 60 | } |
@@ -6,13 +6,13 @@ |
||
| 6 | 6 | |
| 7 | 7 | class TrimStrings extends BaseTrimmer |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * The names of the attributes that should not be trimmed. |
|
| 11 | - * |
|
| 12 | - * @var array |
|
| 13 | - */ |
|
| 14 | - protected $except = [ |
|
| 15 | - 'password', |
|
| 16 | - 'password_confirmation', |
|
| 17 | - ]; |
|
| 9 | + /** |
|
| 10 | + * The names of the attributes that should not be trimmed. |
|
| 11 | + * |
|
| 12 | + * @var array |
|
| 13 | + */ |
|
| 14 | + protected $except = [ |
|
| 15 | + 'password', |
|
| 16 | + 'password_confirmation', |
|
| 17 | + ]; |
|
| 18 | 18 | } |
@@ -7,27 +7,27 @@ |
||
| 7 | 7 | |
| 8 | 8 | class BusServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Bootstrap any application services. |
|
| 12 | - * |
|
| 13 | - * @param \Illuminate\Bus\Dispatcher $dispatcher |
|
| 14 | - */ |
|
| 15 | - public function boot(Dispatcher $dispatcher) |
|
| 16 | - { |
|
| 17 | - $dispatcher->mapUsing(function ($command) { |
|
| 18 | - return Dispatcher::simpleMapping( |
|
| 19 | - $command, |
|
| 20 | - \PiFinder\Commands::class, |
|
| 21 | - \PiFinder\Handlers\Commands::class |
|
| 22 | - ); |
|
| 23 | - }); |
|
| 24 | - } |
|
| 10 | + /** |
|
| 11 | + * Bootstrap any application services. |
|
| 12 | + * |
|
| 13 | + * @param \Illuminate\Bus\Dispatcher $dispatcher |
|
| 14 | + */ |
|
| 15 | + public function boot(Dispatcher $dispatcher) |
|
| 16 | + { |
|
| 17 | + $dispatcher->mapUsing(function ($command) { |
|
| 18 | + return Dispatcher::simpleMapping( |
|
| 19 | + $command, |
|
| 20 | + \PiFinder\Commands::class, |
|
| 21 | + \PiFinder\Handlers\Commands::class |
|
| 22 | + ); |
|
| 23 | + }); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Register any application services. |
|
| 28 | - */ |
|
| 29 | - public function register() |
|
| 30 | - { |
|
| 31 | - // |
|
| 32 | - } |
|
| 26 | + /** |
|
| 27 | + * Register any application services. |
|
| 28 | + */ |
|
| 29 | + public function register() |
|
| 30 | + { |
|
| 31 | + // |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -7,22 +7,22 @@ |
||
| 7 | 7 | |
| 8 | 8 | class AppServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Bootstrap any application services. |
|
| 12 | - */ |
|
| 13 | - public function boot() |
|
| 14 | - { |
|
| 15 | - // |
|
| 16 | - } |
|
| 10 | + /** |
|
| 11 | + * Bootstrap any application services. |
|
| 12 | + */ |
|
| 13 | + public function boot() |
|
| 14 | + { |
|
| 15 | + // |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Register any application services. |
|
| 20 | - */ |
|
| 21 | - public function register() |
|
| 22 | - { |
|
| 23 | - $this->app->bind( |
|
| 24 | - \Illuminate\Contracts\Auth\Registrar::class, |
|
| 25 | - Registrar::class |
|
| 26 | - ); |
|
| 27 | - } |
|
| 18 | + /** |
|
| 19 | + * Register any application services. |
|
| 20 | + */ |
|
| 21 | + public function register() |
|
| 22 | + { |
|
| 23 | + $this->app->bind( |
|
| 24 | + \Illuminate\Contracts\Auth\Registrar::class, |
|
| 25 | + Registrar::class |
|
| 26 | + ); |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -6,26 +6,26 @@ |
||
| 6 | 6 | |
| 7 | 7 | class AuthServiceProvider extends ServiceProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * The policy mappings for the application. |
|
| 11 | - * |
|
| 12 | - * @var array |
|
| 13 | - */ |
|
| 14 | - protected $policies = [ |
|
| 15 | - 'PiFinder\Model' => 'PiFinder\Policies\ModelPolicy', |
|
| 16 | - ]; |
|
| 9 | + /** |
|
| 10 | + * The policy mappings for the application. |
|
| 11 | + * |
|
| 12 | + * @var array |
|
| 13 | + */ |
|
| 14 | + protected $policies = [ |
|
| 15 | + 'PiFinder\Model' => 'PiFinder\Policies\ModelPolicy', |
|
| 16 | + ]; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Register any application authentication / authorization services. |
|
| 20 | - * |
|
| 21 | - * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
|
| 22 | - * |
|
| 23 | - * @return void |
|
| 24 | - */ |
|
| 25 | - public function boot() |
|
| 26 | - { |
|
| 27 | - $this->registerPolicies(); |
|
| 18 | + /** |
|
| 19 | + * Register any application authentication / authorization services. |
|
| 20 | + * |
|
| 21 | + * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
|
| 22 | + * |
|
| 23 | + * @return void |
|
| 24 | + */ |
|
| 25 | + public function boot() |
|
| 26 | + { |
|
| 27 | + $this->registerPolicies(); |
|
| 28 | 28 | |
| 29 | - // |
|
| 30 | - } |
|
| 29 | + // |
|
| 30 | + } |
|
| 31 | 31 | } |
@@ -7,23 +7,23 @@ |
||
| 7 | 7 | |
| 8 | 8 | class ObserverServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Bootstrap the application services. |
|
| 12 | - * |
|
| 13 | - * @return void |
|
| 14 | - */ |
|
| 15 | - public function boot() |
|
| 16 | - { |
|
| 17 | - Device::observe(app(\PiFinder\Observers\DeviceObserver::class)); |
|
| 18 | - } |
|
| 10 | + /** |
|
| 11 | + * Bootstrap the application services. |
|
| 12 | + * |
|
| 13 | + * @return void |
|
| 14 | + */ |
|
| 15 | + public function boot() |
|
| 16 | + { |
|
| 17 | + Device::observe(app(\PiFinder\Observers\DeviceObserver::class)); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Register the application services. |
|
| 22 | - * |
|
| 23 | - * @return void |
|
| 24 | - */ |
|
| 25 | - public function register() |
|
| 26 | - { |
|
| 27 | - // |
|
| 28 | - } |
|
| 20 | + /** |
|
| 21 | + * Register the application services. |
|
| 22 | + * |
|
| 23 | + * @return void |
|
| 24 | + */ |
|
| 25 | + public function register() |
|
| 26 | + { |
|
| 27 | + // |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -8,52 +8,52 @@ |
||
| 8 | 8 | |
| 9 | 9 | class NotifyUsersAboutPoke |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * The Pusher instance. |
|
| 13 | - * |
|
| 14 | - * @var PusherManager |
|
| 15 | - */ |
|
| 16 | - protected $pusher; |
|
| 17 | - |
|
| 18 | - /** |
|
| 19 | - * @var DeviceTransformer |
|
| 20 | - */ |
|
| 21 | - private $transformer; |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * Create the event handler. |
|
| 25 | - * |
|
| 26 | - * @param PusherManager $pusher |
|
| 27 | - * @param DeviceTransformer $transformer |
|
| 28 | - */ |
|
| 29 | - public function __construct(PusherManager $pusher, DeviceTransformer $transformer) |
|
| 30 | - { |
|
| 31 | - $this->pusher = $pusher; |
|
| 32 | - $this->transformer = $transformer; |
|
| 33 | - } |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Handle the server was poked event. |
|
| 37 | - * |
|
| 38 | - * @param ServerWasPoked $event |
|
| 39 | - * |
|
| 40 | - * @return void |
|
| 41 | - */ |
|
| 42 | - public function handle(ServerWasPoked $event) |
|
| 43 | - { |
|
| 44 | - $channel = config('broadcasting.connections.pusher.channel'); |
|
| 45 | - $device = $event->getDevice(); |
|
| 46 | - |
|
| 47 | - if ($device->isPublic()) { |
|
| 48 | - $this->pusher->trigger($channel, 'ServerWasPoked', [ |
|
| 49 | - 'device' => $this->transformer->transform($device), |
|
| 50 | - ]); |
|
| 51 | - } else { |
|
| 52 | - $channel = $channel.'-'.$device->group; |
|
| 53 | - |
|
| 54 | - $this->pusher->trigger($channel, 'ServerWasPoked', [ |
|
| 55 | - 'device' => $this->transformer->transform($device), |
|
| 56 | - ]); |
|
| 57 | - } |
|
| 58 | - } |
|
| 11 | + /** |
|
| 12 | + * The Pusher instance. |
|
| 13 | + * |
|
| 14 | + * @var PusherManager |
|
| 15 | + */ |
|
| 16 | + protected $pusher; |
|
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * @var DeviceTransformer |
|
| 20 | + */ |
|
| 21 | + private $transformer; |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * Create the event handler. |
|
| 25 | + * |
|
| 26 | + * @param PusherManager $pusher |
|
| 27 | + * @param DeviceTransformer $transformer |
|
| 28 | + */ |
|
| 29 | + public function __construct(PusherManager $pusher, DeviceTransformer $transformer) |
|
| 30 | + { |
|
| 31 | + $this->pusher = $pusher; |
|
| 32 | + $this->transformer = $transformer; |
|
| 33 | + } |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Handle the server was poked event. |
|
| 37 | + * |
|
| 38 | + * @param ServerWasPoked $event |
|
| 39 | + * |
|
| 40 | + * @return void |
|
| 41 | + */ |
|
| 42 | + public function handle(ServerWasPoked $event) |
|
| 43 | + { |
|
| 44 | + $channel = config('broadcasting.connections.pusher.channel'); |
|
| 45 | + $device = $event->getDevice(); |
|
| 46 | + |
|
| 47 | + if ($device->isPublic()) { |
|
| 48 | + $this->pusher->trigger($channel, 'ServerWasPoked', [ |
|
| 49 | + 'device' => $this->transformer->transform($device), |
|
| 50 | + ]); |
|
| 51 | + } else { |
|
| 52 | + $channel = $channel.'-'.$device->group; |
|
| 53 | + |
|
| 54 | + $this->pusher->trigger($channel, 'ServerWasPoked', [ |
|
| 55 | + 'device' => $this->transformer->transform($device), |
|
| 56 | + ]); |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | 59 | } |
@@ -7,15 +7,15 @@ |
||
| 7 | 7 | |
| 8 | 8 | class BroadcastServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Bootstrap any application services. |
|
| 12 | - * |
|
| 13 | - * @return void |
|
| 14 | - */ |
|
| 15 | - public function boot() |
|
| 16 | - { |
|
| 17 | - Broadcast::routes(); |
|
| 10 | + /** |
|
| 11 | + * Bootstrap any application services. |
|
| 12 | + * |
|
| 13 | + * @return void |
|
| 14 | + */ |
|
| 15 | + public function boot() |
|
| 16 | + { |
|
| 17 | + Broadcast::routes(); |
|
| 18 | 18 | |
| 19 | - require base_path('routes/channels.php'); |
|
| 20 | - } |
|
| 19 | + require base_path('routes/channels.php'); |
|
| 20 | + } |
|
| 21 | 21 | } |
@@ -7,35 +7,35 @@ |
||
| 7 | 7 | |
| 8 | 8 | class Kernel extends ConsoleKernel |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * The Artisan commands provided by your application. |
|
| 12 | - * |
|
| 13 | - * @var array |
|
| 14 | - */ |
|
| 15 | - protected $commands = [ |
|
| 16 | - \PiFinder\Console\Commands\FlushOldDevices::class, |
|
| 17 | - \PiFinder\Console\Commands\UserCreate::class, |
|
| 18 | - \PiFinder\Console\Commands\UserDelete::class, |
|
| 19 | - ]; |
|
| 10 | + /** |
|
| 11 | + * The Artisan commands provided by your application. |
|
| 12 | + * |
|
| 13 | + * @var array |
|
| 14 | + */ |
|
| 15 | + protected $commands = [ |
|
| 16 | + \PiFinder\Console\Commands\FlushOldDevices::class, |
|
| 17 | + \PiFinder\Console\Commands\UserCreate::class, |
|
| 18 | + \PiFinder\Console\Commands\UserDelete::class, |
|
| 19 | + ]; |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * Define the application's command schedule. |
|
| 23 | - * |
|
| 24 | - * @param \Illuminate\Console\Scheduling\Schedule $schedule |
|
| 25 | - */ |
|
| 26 | - protected function schedule(Schedule $schedule) |
|
| 27 | - { |
|
| 28 | - $schedule->command('pi:flush') |
|
| 29 | - ->everyFiveMinutes(); |
|
| 30 | - } |
|
| 21 | + /** |
|
| 22 | + * Define the application's command schedule. |
|
| 23 | + * |
|
| 24 | + * @param \Illuminate\Console\Scheduling\Schedule $schedule |
|
| 25 | + */ |
|
| 26 | + protected function schedule(Schedule $schedule) |
|
| 27 | + { |
|
| 28 | + $schedule->command('pi:flush') |
|
| 29 | + ->everyFiveMinutes(); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Register the Closure based commands for the application. |
|
| 34 | - * |
|
| 35 | - * @return void |
|
| 36 | - */ |
|
| 37 | - protected function commands() |
|
| 38 | - { |
|
| 39 | - require base_path('routes/console.php'); |
|
| 40 | - } |
|
| 32 | + /** |
|
| 33 | + * Register the Closure based commands for the application. |
|
| 34 | + * |
|
| 35 | + * @return void |
|
| 36 | + */ |
|
| 37 | + protected function commands() |
|
| 38 | + { |
|
| 39 | + require base_path('routes/console.php'); |
|
| 40 | + } |
|
| 41 | 41 | } |