@@ -6,30 +6,30 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ModuleServiceProvider extends ServiceProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Bootstrap the module services. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function boot() |
|
| 15 | - { |
|
| 16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'notifications'); |
|
| 17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'notifications'); |
|
| 9 | + /** |
|
| 10 | + * Bootstrap the module services. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function boot() |
|
| 15 | + { |
|
| 16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'notifications'); |
|
| 17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'notifications'); |
|
| 18 | 18 | |
| 19 | - $this->loadMigrationsFrom(module_path('notifications', 'Database/Migrations', 'app')); |
|
| 20 | - $this->loadFactoriesFrom(module_path('notifications', 'Database/Factories', 'app')); |
|
| 21 | - if(!$this->app->configurationIsCached()) { |
|
| 22 | - $this->loadConfigsFrom(module_path('notifications', 'Config', 'app')); |
|
| 23 | - } |
|
| 24 | - } |
|
| 19 | + $this->loadMigrationsFrom(module_path('notifications', 'Database/Migrations', 'app')); |
|
| 20 | + $this->loadFactoriesFrom(module_path('notifications', 'Database/Factories', 'app')); |
|
| 21 | + if(!$this->app->configurationIsCached()) { |
|
| 22 | + $this->loadConfigsFrom(module_path('notifications', 'Config', 'app')); |
|
| 23 | + } |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Register the module services. |
|
| 28 | - * |
|
| 29 | - * @return void |
|
| 30 | - */ |
|
| 31 | - public function register() |
|
| 32 | - { |
|
| 33 | - $this->app->register(RouteServiceProvider::class); |
|
| 34 | - } |
|
| 26 | + /** |
|
| 27 | + * Register the module services. |
|
| 28 | + * |
|
| 29 | + * @return void |
|
| 30 | + */ |
|
| 31 | + public function register() |
|
| 32 | + { |
|
| 33 | + $this->app->register(RouteServiceProvider::class); |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | $this->loadMigrationsFrom(module_path('notifications', 'Database/Migrations', 'app')); |
| 20 | 20 | $this->loadFactoriesFrom(module_path('notifications', 'Database/Factories', 'app')); |
| 21 | - if(!$this->app->configurationIsCached()) { |
|
| 21 | + if ( ! $this->app->configurationIsCached()) { |
|
| 22 | 22 | $this->loadConfigsFrom(module_path('notifications', 'Config', 'app')); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -9,43 +9,43 @@ |
||
| 9 | 9 | |
| 10 | 10 | class ResetPassword extends Notification implements ShouldQueue |
| 11 | 11 | { |
| 12 | - use Queueable; |
|
| 12 | + use Queueable; |
|
| 13 | 13 | |
| 14 | - protected $token; |
|
| 14 | + protected $token; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Init new object. |
|
| 18 | - * |
|
| 19 | - * @return void |
|
| 20 | - */ |
|
| 21 | - public function __construct($token) |
|
| 22 | - { |
|
| 23 | - $this->token = $token; |
|
| 24 | - } |
|
| 16 | + /** |
|
| 17 | + * Init new object. |
|
| 18 | + * |
|
| 19 | + * @return void |
|
| 20 | + */ |
|
| 21 | + public function __construct($token) |
|
| 22 | + { |
|
| 23 | + $this->token = $token; |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Get the notification's delivery channels. |
|
| 28 | - * |
|
| 29 | - * @param mixed $notifiable |
|
| 30 | - * @return string[] |
|
| 31 | - */ |
|
| 32 | - public function via($notifiable) |
|
| 33 | - { |
|
| 34 | - return ['mail']; |
|
| 35 | - } |
|
| 26 | + /** |
|
| 27 | + * Get the notification's delivery channels. |
|
| 28 | + * |
|
| 29 | + * @param mixed $notifiable |
|
| 30 | + * @return string[] |
|
| 31 | + */ |
|
| 32 | + public function via($notifiable) |
|
| 33 | + { |
|
| 34 | + return ['mail']; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Get the mail representation of the notification. |
|
| 39 | - * |
|
| 40 | - * @param mixed $notifiable |
|
| 41 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
| 42 | - */ |
|
| 43 | - public function toMail($notifiable) |
|
| 44 | - { |
|
| 45 | - return (new MailMessage) |
|
| 46 | - ->subject('Reset passowrd') |
|
| 47 | - ->line('Reset passowrd') |
|
| 48 | - ->line('To reset your password click on the button below') |
|
| 49 | - ->action('Reset password', config('user.reset_password_url').'/'.$this->token); |
|
| 50 | - } |
|
| 37 | + /** |
|
| 38 | + * Get the mail representation of the notification. |
|
| 39 | + * |
|
| 40 | + * @param mixed $notifiable |
|
| 41 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
| 42 | + */ |
|
| 43 | + public function toMail($notifiable) |
|
| 44 | + { |
|
| 45 | + return (new MailMessage) |
|
| 46 | + ->subject('Reset passowrd') |
|
| 47 | + ->line('Reset passowrd') |
|
| 48 | + ->line('To reset your password click on the button below') |
|
| 49 | + ->action('Reset password', config('user.reset_password_url').'/'.$this->token); |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -9,41 +9,41 @@ |
||
| 9 | 9 | |
| 10 | 10 | class ConfirmEmail extends Notification implements ShouldQueue |
| 11 | 11 | { |
| 12 | - use Queueable; |
|
| 12 | + use Queueable; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Init new object. |
|
| 16 | - * |
|
| 17 | - * @return void |
|
| 18 | - */ |
|
| 19 | - public function __construct() |
|
| 20 | - { |
|
| 21 | - // |
|
| 22 | - } |
|
| 14 | + /** |
|
| 15 | + * Init new object. |
|
| 16 | + * |
|
| 17 | + * @return void |
|
| 18 | + */ |
|
| 19 | + public function __construct() |
|
| 20 | + { |
|
| 21 | + // |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Get the notification's delivery channels. |
|
| 26 | - * |
|
| 27 | - * @param mixed $notifiable |
|
| 28 | - * @return string[] |
|
| 29 | - */ |
|
| 30 | - public function via($notifiable) |
|
| 31 | - { |
|
| 32 | - return ['mail']; |
|
| 33 | - } |
|
| 24 | + /** |
|
| 25 | + * Get the notification's delivery channels. |
|
| 26 | + * |
|
| 27 | + * @param mixed $notifiable |
|
| 28 | + * @return string[] |
|
| 29 | + */ |
|
| 30 | + public function via($notifiable) |
|
| 31 | + { |
|
| 32 | + return ['mail']; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Get the mail representation of the notification. |
|
| 37 | - * |
|
| 38 | - * @param mixed $notifiable |
|
| 39 | - * @return \Illuminate\Notifications\Messages\MailMessage |
|
| 40 | - */ |
|
| 41 | - public function toMail($notifiable) |
|
| 42 | - { |
|
| 43 | - return (new MailMessage) |
|
| 44 | - ->subject('Email verification') |
|
| 45 | - ->line('Email verification') |
|
| 46 | - ->line('To validate your email click on the button below') |
|
| 47 | - ->action('Verify your email', config('user.confrim_email_url').'/'.$notifiable->confirmation_code); |
|
| 48 | - } |
|
| 35 | + /** |
|
| 36 | + * Get the mail representation of the notification. |
|
| 37 | + * |
|
| 38 | + * @param mixed $notifiable |
|
| 39 | + * @return \Illuminate\Notifications\Messages\MailMessage |
|
| 40 | + */ |
|
| 41 | + public function toMail($notifiable) |
|
| 42 | + { |
|
| 43 | + return (new MailMessage) |
|
| 44 | + ->subject('Email verification') |
|
| 45 | + ->line('Email verification') |
|
| 46 | + ->line('To validate your email click on the button below') |
|
| 47 | + ->action('Verify your email', config('user.confrim_email_url').'/'.$notifiable->confirmation_code); |
|
| 48 | + } |
|
| 49 | 49 | } |
@@ -6,30 +6,30 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ModuleServiceProvider extends ServiceProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Bootstrap the module services. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function boot() |
|
| 15 | - { |
|
| 16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'roles'); |
|
| 17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'roles'); |
|
| 9 | + /** |
|
| 10 | + * Bootstrap the module services. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function boot() |
|
| 15 | + { |
|
| 16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'roles'); |
|
| 17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'roles'); |
|
| 18 | 18 | |
| 19 | - $this->loadMigrationsFrom(module_path('roles', 'Database/Migrations', 'app')); |
|
| 20 | - $this->loadFactoriesFrom(module_path('roles', 'Database/Factories', 'app')); |
|
| 21 | - if(!$this->app->configurationIsCached()) { |
|
| 22 | - $this->loadConfigsFrom(module_path('roles', 'Config', 'app')); |
|
| 23 | - } |
|
| 24 | - } |
|
| 19 | + $this->loadMigrationsFrom(module_path('roles', 'Database/Migrations', 'app')); |
|
| 20 | + $this->loadFactoriesFrom(module_path('roles', 'Database/Factories', 'app')); |
|
| 21 | + if(!$this->app->configurationIsCached()) { |
|
| 22 | + $this->loadConfigsFrom(module_path('roles', 'Config', 'app')); |
|
| 23 | + } |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Register the module services. |
|
| 28 | - * |
|
| 29 | - * @return void |
|
| 30 | - */ |
|
| 31 | - public function register() |
|
| 32 | - { |
|
| 33 | - $this->app->register(RouteServiceProvider::class); |
|
| 34 | - } |
|
| 26 | + /** |
|
| 27 | + * Register the module services. |
|
| 28 | + * |
|
| 29 | + * @return void |
|
| 30 | + */ |
|
| 31 | + public function register() |
|
| 32 | + { |
|
| 33 | + $this->app->register(RouteServiceProvider::class); |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | $this->loadMigrationsFrom(module_path('roles', 'Database/Migrations', 'app')); |
| 20 | 20 | $this->loadFactoriesFrom(module_path('roles', 'Database/Factories', 'app')); |
| 21 | - if(!$this->app->configurationIsCached()) { |
|
| 21 | + if ( ! $this->app->configurationIsCached()) { |
|
| 22 | 22 | $this->loadConfigsFrom(module_path('roles', 'Config', 'app')); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -7,38 +7,38 @@ |
||
| 7 | 7 | |
| 8 | 8 | class PassportInstallCommand extends Command |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * The name and signature of the console command. |
|
| 12 | - * |
|
| 13 | - * @var string |
|
| 14 | - */ |
|
| 15 | - protected $signature = 'module:passport:install |
|
| 10 | + /** |
|
| 11 | + * The name and signature of the console command. |
|
| 12 | + * |
|
| 13 | + * @var string |
|
| 14 | + */ |
|
| 15 | + protected $signature = 'module:passport:install |
|
| 16 | 16 | {--force : Overwrite keys they already exist} |
| 17 | 17 | {--length=4096 : The length of the private key}'; |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * The console command description. |
|
| 21 | - * |
|
| 22 | - * @var string |
|
| 23 | - */ |
|
| 24 | - protected $description = 'Run the commands necessary to prepare Passport for use'; |
|
| 19 | + /** |
|
| 20 | + * The console command description. |
|
| 21 | + * |
|
| 22 | + * @var string |
|
| 23 | + */ |
|
| 24 | + protected $description = 'Run the commands necessary to prepare Passport for use'; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Execute the console command. |
|
| 28 | - * |
|
| 29 | - * @return void |
|
| 30 | - */ |
|
| 31 | - public function handle(ClientRepository $client) |
|
| 32 | - { |
|
| 33 | - $this->call('passport:keys', ['--force' => $this->option('force'), '--length' => $this->option('length')]); |
|
| 34 | - if( ! \Core::oauthCLients()->first(['password_client' => 1])) { |
|
| 26 | + /** |
|
| 27 | + * Execute the console command. |
|
| 28 | + * |
|
| 29 | + * @return void |
|
| 30 | + */ |
|
| 31 | + public function handle(ClientRepository $client) |
|
| 32 | + { |
|
| 33 | + $this->call('passport:keys', ['--force' => $this->option('force'), '--length' => $this->option('length')]); |
|
| 34 | + if( ! \Core::oauthCLients()->first(['password_client' => 1])) { |
|
| 35 | 35 | |
| 36 | - $client = $client->createPasswordGrantClient( |
|
| 37 | - null, config('app.name'), 'http://localhost' |
|
| 38 | - ); |
|
| 39 | - \DotenvEditor::setKey('PASSWORD_CLIENT_ID', $client->id); |
|
| 40 | - \DotenvEditor::setKey('PASSWORD_CLIENT_SECRET', $client->secret); |
|
| 41 | - \DotenvEditor::save(); |
|
| 42 | - } |
|
| 43 | - } |
|
| 36 | + $client = $client->createPasswordGrantClient( |
|
| 37 | + null, config('app.name'), 'http://localhost' |
|
| 38 | + ); |
|
| 39 | + \DotenvEditor::setKey('PASSWORD_CLIENT_ID', $client->id); |
|
| 40 | + \DotenvEditor::setKey('PASSWORD_CLIENT_SECRET', $client->secret); |
|
| 41 | + \DotenvEditor::save(); |
|
| 42 | + } |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | public function handle(ClientRepository $client) |
| 32 | 32 | { |
| 33 | 33 | $this->call('passport:keys', ['--force' => $this->option('force'), '--length' => $this->option('length')]); |
| 34 | - if( ! \Core::oauthCLients()->first(['password_client' => 1])) { |
|
| 34 | + if ( ! \Core::oauthCLients()->first(['password_client' => 1])) { |
|
| 35 | 35 | |
| 36 | 36 | $client = $client->createPasswordGrantClient( |
| 37 | 37 | null, config('app.name'), 'http://localhost' |
@@ -6,30 +6,30 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ModuleServiceProvider extends ServiceProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Bootstrap the module services. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function boot() |
|
| 15 | - { |
|
| 16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'DummyModuleSlug'); |
|
| 17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'DummyModuleSlug'); |
|
| 9 | + /** |
|
| 10 | + * Bootstrap the module services. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function boot() |
|
| 15 | + { |
|
| 16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'DummyModuleSlug'); |
|
| 17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'DummyModuleSlug'); |
|
| 18 | 18 | |
| 19 | - $this->loadMigrationsFrom(module_path('DummyModuleSlug', 'Database/Migrations', 'app')); |
|
| 20 | - $this->loadFactoriesFrom(module_path('DummyModuleSlug', 'Database/Factories', 'app')); |
|
| 21 | - if(!$this->app->configurationIsCached()) { |
|
| 22 | - $this->loadConfigsFrom(module_path('DummyModuleSlug', 'Config', 'app')); |
|
| 23 | - } |
|
| 24 | - } |
|
| 19 | + $this->loadMigrationsFrom(module_path('DummyModuleSlug', 'Database/Migrations', 'app')); |
|
| 20 | + $this->loadFactoriesFrom(module_path('DummyModuleSlug', 'Database/Factories', 'app')); |
|
| 21 | + if(!$this->app->configurationIsCached()) { |
|
| 22 | + $this->loadConfigsFrom(module_path('DummyModuleSlug', 'Config', 'app')); |
|
| 23 | + } |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Register the module services. |
|
| 28 | - * |
|
| 29 | - * @return void |
|
| 30 | - */ |
|
| 31 | - public function register() |
|
| 32 | - { |
|
| 33 | - $this->app->register(RouteServiceProvider::class); |
|
| 34 | - } |
|
| 26 | + /** |
|
| 27 | + * Register the module services. |
|
| 28 | + * |
|
| 29 | + * @return void |
|
| 30 | + */ |
|
| 31 | + public function register() |
|
| 32 | + { |
|
| 33 | + $this->app->register(RouteServiceProvider::class); |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | $this->loadMigrationsFrom(module_path('DummyModuleSlug', 'Database/Migrations', 'app')); |
| 20 | 20 | $this->loadFactoriesFrom(module_path('DummyModuleSlug', 'Database/Factories', 'app')); |
| 21 | - if(!$this->app->configurationIsCached()) { |
|
| 21 | + if ( ! $this->app->configurationIsCached()) { |
|
| 22 | 22 | $this->loadConfigsFrom(module_path('DummyModuleSlug', 'Config', 'app')); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -11,5 +11,5 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | if (\App::environment('local')) { |
| 14 | - Route::get('/docs', 'ApiDocumentController@index'); |
|
| 14 | + Route::get('/docs', 'ApiDocumentController@index'); |
|
| 15 | 15 | } |
| 16 | 16 | \ No newline at end of file |
@@ -6,51 +6,51 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ModuleServiceProvider extends ServiceProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Bootstrap the module services. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function boot() |
|
| 15 | - { |
|
| 16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'core'); |
|
| 17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'core'); |
|
| 18 | - |
|
| 19 | - $this->loadMigrationsFrom(module_path('core', 'Database/Migrations', 'app')); |
|
| 20 | - $this->loadFactoriesFrom(module_path('core', 'Database/Factories', 'app')); |
|
| 21 | - if(!$this->app->configurationIsCached()) { |
|
| 22 | - $this->loadConfigsFrom(module_path('core', 'Config', 'app')); |
|
| 23 | - } |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - /** |
|
| 27 | - * Register the module services. |
|
| 28 | - * |
|
| 29 | - * @return void |
|
| 30 | - */ |
|
| 31 | - public function register() |
|
| 32 | - { |
|
| 33 | - //Bind Core Facade to the Service Container |
|
| 34 | - $this->app->singleton('Core', function () { |
|
| 35 | - return new \App\Modules\Core\Core; |
|
| 36 | - }); |
|
| 37 | - |
|
| 38 | - //Bind Errors Facade to the Service Container |
|
| 39 | - $this->app->singleton('Errors', function () { |
|
| 40 | - return new \App\Modules\Core\Errors\Errors; |
|
| 41 | - }); |
|
| 42 | - |
|
| 43 | - //Bind Media Facade to the Service Container |
|
| 44 | - $this->app->singleton('Media', function () { |
|
| 45 | - return new \App\Modules\Core\Utl\Media; |
|
| 46 | - }); |
|
| 47 | - |
|
| 48 | - //Bind ApiConsumer Facade to the Service Container |
|
| 49 | - $this->app->singleton('ApiConsumer', function () { |
|
| 50 | - $app = app(); |
|
| 51 | - return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']); |
|
| 52 | - }); |
|
| 9 | + /** |
|
| 10 | + * Bootstrap the module services. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function boot() |
|
| 15 | + { |
|
| 16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'core'); |
|
| 17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'core'); |
|
| 18 | + |
|
| 19 | + $this->loadMigrationsFrom(module_path('core', 'Database/Migrations', 'app')); |
|
| 20 | + $this->loadFactoriesFrom(module_path('core', 'Database/Factories', 'app')); |
|
| 21 | + if(!$this->app->configurationIsCached()) { |
|
| 22 | + $this->loadConfigsFrom(module_path('core', 'Config', 'app')); |
|
| 23 | + } |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * Register the module services. |
|
| 28 | + * |
|
| 29 | + * @return void |
|
| 30 | + */ |
|
| 31 | + public function register() |
|
| 32 | + { |
|
| 33 | + //Bind Core Facade to the Service Container |
|
| 34 | + $this->app->singleton('Core', function () { |
|
| 35 | + return new \App\Modules\Core\Core; |
|
| 36 | + }); |
|
| 37 | + |
|
| 38 | + //Bind Errors Facade to the Service Container |
|
| 39 | + $this->app->singleton('Errors', function () { |
|
| 40 | + return new \App\Modules\Core\Errors\Errors; |
|
| 41 | + }); |
|
| 42 | + |
|
| 43 | + //Bind Media Facade to the Service Container |
|
| 44 | + $this->app->singleton('Media', function () { |
|
| 45 | + return new \App\Modules\Core\Utl\Media; |
|
| 46 | + }); |
|
| 47 | + |
|
| 48 | + //Bind ApiConsumer Facade to the Service Container |
|
| 49 | + $this->app->singleton('ApiConsumer', function () { |
|
| 50 | + $app = app(); |
|
| 51 | + return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']); |
|
| 52 | + }); |
|
| 53 | 53 | |
| 54 | - $this->app->register(RouteServiceProvider::class); |
|
| 55 | - } |
|
| 54 | + $this->app->register(RouteServiceProvider::class); |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $this->loadMigrationsFrom(module_path('core', 'Database/Migrations', 'app')); |
| 20 | 20 | $this->loadFactoriesFrom(module_path('core', 'Database/Factories', 'app')); |
| 21 | - if(!$this->app->configurationIsCached()) { |
|
| 21 | + if ( ! $this->app->configurationIsCached()) { |
|
| 22 | 22 | $this->loadConfigsFrom(module_path('core', 'Config', 'app')); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -31,22 +31,22 @@ discard block |
||
| 31 | 31 | public function register() |
| 32 | 32 | { |
| 33 | 33 | //Bind Core Facade to the Service Container |
| 34 | - $this->app->singleton('Core', function () { |
|
| 34 | + $this->app->singleton('Core', function() { |
|
| 35 | 35 | return new \App\Modules\Core\Core; |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | 38 | //Bind Errors Facade to the Service Container |
| 39 | - $this->app->singleton('Errors', function () { |
|
| 39 | + $this->app->singleton('Errors', function() { |
|
| 40 | 40 | return new \App\Modules\Core\Errors\Errors; |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | 43 | //Bind Media Facade to the Service Container |
| 44 | - $this->app->singleton('Media', function () { |
|
| 44 | + $this->app->singleton('Media', function() { |
|
| 45 | 45 | return new \App\Modules\Core\Utl\Media; |
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | 48 | //Bind ApiConsumer Facade to the Service Container |
| 49 | - $this->app->singleton('ApiConsumer', function () { |
|
| 49 | + $this->app->singleton('ApiConsumer', function() { |
|
| 50 | 50 | $app = app(); |
| 51 | 51 | return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']); |
| 52 | 52 | }); |
@@ -8,40 +8,40 @@ |
||
| 8 | 8 | |
| 9 | 9 | class SetRelations |
| 10 | 10 | { |
| 11 | - protected $arr; |
|
| 12 | - protected $route; |
|
| 11 | + protected $arr; |
|
| 12 | + protected $route; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Init new object. |
|
| 16 | - * |
|
| 17 | - * @param Route $route |
|
| 18 | - * @param Arr $arr |
|
| 19 | - * |
|
| 20 | - * @return void |
|
| 21 | - */ |
|
| 22 | - public function __construct(Route $route, Arr $arr) |
|
| 23 | - { |
|
| 24 | - $this->arr = $arr; |
|
| 25 | - $this->route = $route; |
|
| 26 | - } |
|
| 14 | + /** |
|
| 15 | + * Init new object. |
|
| 16 | + * |
|
| 17 | + * @param Route $route |
|
| 18 | + * @param Arr $arr |
|
| 19 | + * |
|
| 20 | + * @return void |
|
| 21 | + */ |
|
| 22 | + public function __construct(Route $route, Arr $arr) |
|
| 23 | + { |
|
| 24 | + $this->arr = $arr; |
|
| 25 | + $this->route = $route; |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Handle an incoming request. |
|
| 30 | - * |
|
| 31 | - * @param \Illuminate\Http\Request $request |
|
| 32 | - * @param \Closure $next |
|
| 33 | - * @return mixed |
|
| 34 | - */ |
|
| 35 | - public function handle($request, Closure $next) |
|
| 36 | - { |
|
| 37 | - $routeActions = explode('@', $this->route->currentRouteAction()); |
|
| 38 | - $modelName = explode('\\', $routeActions[0]); |
|
| 39 | - $modelName = lcfirst(str_replace('Controller', '', end($modelName))); |
|
| 40 | - $route = explode('@', $this->route->currentRouteAction())[1]; |
|
| 41 | - $route = $route !== 'index' ? $route : 'list'; |
|
| 42 | - $relations = $this->arr->get(config('core.relations'), $modelName, false); |
|
| 43 | - $request->relations = $relations && isset($relations[$route]) ? $relations[$route] : []; |
|
| 28 | + /** |
|
| 29 | + * Handle an incoming request. |
|
| 30 | + * |
|
| 31 | + * @param \Illuminate\Http\Request $request |
|
| 32 | + * @param \Closure $next |
|
| 33 | + * @return mixed |
|
| 34 | + */ |
|
| 35 | + public function handle($request, Closure $next) |
|
| 36 | + { |
|
| 37 | + $routeActions = explode('@', $this->route->currentRouteAction()); |
|
| 38 | + $modelName = explode('\\', $routeActions[0]); |
|
| 39 | + $modelName = lcfirst(str_replace('Controller', '', end($modelName))); |
|
| 40 | + $route = explode('@', $this->route->currentRouteAction())[1]; |
|
| 41 | + $route = $route !== 'index' ? $route : 'list'; |
|
| 42 | + $relations = $this->arr->get(config('core.relations'), $modelName, false); |
|
| 43 | + $request->relations = $relations && isset($relations[$route]) ? $relations[$route] : []; |
|
| 44 | 44 | |
| 45 | - return $next($request); |
|
| 46 | - } |
|
| 45 | + return $next($request); |
|
| 46 | + } |
|
| 47 | 47 | } |