Completed
Push — master ( ab2185...c08f71 )
by Sherif
01:55
created
src/Modules/Notifications/Providers/ModuleServiceProvider.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Modules/Notifications/Notifications/ResetPassword.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -9,43 +9,43 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Modules/Notifications/Notifications/ConfirmEmail.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -9,41 +9,41 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Modules/Roles/Providers/ModuleServiceProvider.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Modules/Core/Console/Commands/PassportInstallCommand.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -7,38 +7,38 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
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'
Please login to merge, or discard this patch.
Core/Console/Commands/Stubs/Module/Providers/ModuleServiceProvider.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Modules/Core/Routes/web.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,5 +11,5 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Modules/Core/Providers/ModuleServiceProvider.php 2 patches
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -6,51 +6,51 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         });
Please login to merge, or discard this patch.
src/Modules/Core/Http/Middleware/SetRelations.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -8,40 +8,40 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.