Completed
Push — master ( f30158...bfbb50 )
by Sherif
02:18
created
files/Handler.php 3 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Exceptions;
4 4
 
5
-use Exception;
5
+use Exception;
6 6
 use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
7 7
 
8 8
 class Handler extends ExceptionHandler
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
                 return \Response::json(['errors' => [$errors]], $exception->getStatusCode());
64 64
             } elseif ($exception instanceof \Illuminate\Validation\ValidationException) {
65 65
                 return \Response::json(['errors' => $exception->errors()], 422);
66
-            } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
66
+            } elseif ( ! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
67 67
                 return parent::render($request, $exception);
68 68
             }
69 69
         }
Please login to merge, or discard this patch.
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -7,67 +7,67 @@
 block discarded – undo
7 7
 
8 8
 class Handler extends ExceptionHandler
9 9
 {
10
-    /**
11
-     * A list of the exception types that are not reported.
12
-     *
13
-     * @var array
14
-     */
15
-    protected $dontReport = [
16
-        \League\OAuth2\Server\Exception\OAuthServerException::class,
17
-    ];
10
+	/**
11
+	 * A list of the exception types that are not reported.
12
+	 *
13
+	 * @var array
14
+	 */
15
+	protected $dontReport = [
16
+		\League\OAuth2\Server\Exception\OAuthServerException::class,
17
+	];
18 18
 
19
-    /**
20
-     * A list of the inputs that are never flashed for validation exceptions.
21
-     *
22
-     * @var array
23
-     */
24
-    protected $dontFlash = [
25
-        'password',
26
-        'password_confirmation',
27
-    ];
19
+	/**
20
+	 * A list of the inputs that are never flashed for validation exceptions.
21
+	 *
22
+	 * @var array
23
+	 */
24
+	protected $dontFlash = [
25
+		'password',
26
+		'password_confirmation',
27
+	];
28 28
 
29
-    /**
30
-     * Report or log an exception.
31
-     *
32
-     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
33
-     *
34
-     * @param  \Exception  $exception
35
-     * @return void
36
-     */
37
-    public function report(Exception $exception)
38
-    {
39
-        parent::report($exception);
40
-    }
29
+	/**
30
+	 * Report or log an exception.
31
+	 *
32
+	 * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
33
+	 *
34
+	 * @param  \Exception  $exception
35
+	 * @return void
36
+	 */
37
+	public function report(Exception $exception)
38
+	{
39
+		parent::report($exception);
40
+	}
41 41
 
42
-    /**
43
-     * Render an exception into an HTTP response.
44
-     *
45
-     * @param  \Illuminate\Http\Request  $request
46
-     * @param  \Exception  $exception
47
-     * @return \Illuminate\Http\Response
48
-     */
49
-    public function render($request, Exception $exception)
50
-    {
51
-        if ($request->wantsJson()) {
52
-            if ($exception instanceof \Illuminate\Auth\AuthenticationException) {
53
-                \Errors::unAuthorized();
54
-            }
55
-            if ($exception instanceof \Illuminate\Database\QueryException) {
56
-                \Errors::dbQueryError();
57
-            } elseif ($exception instanceof \predis\connection\connectionexception) {
58
-                \Errors::redisNotRunning();
59
-            } elseif ($exception instanceof \GuzzleHttp\Exception\ClientException) {
60
-                \Errors::connectionError();
61
-            } elseif ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) {
62
-                $errors = $exception->getStatusCode() === 404 ? 'not found' : $exception->getMessage();
63
-                return \Response::json(['errors' => [$errors]], $exception->getStatusCode());
64
-            } elseif ($exception instanceof \Illuminate\Validation\ValidationException) {
65
-                return \Response::json(['errors' => $exception->errors()], 422);
66
-            } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
67
-                return parent::render($request, $exception);
68
-            }
69
-        }
42
+	/**
43
+	 * Render an exception into an HTTP response.
44
+	 *
45
+	 * @param  \Illuminate\Http\Request  $request
46
+	 * @param  \Exception  $exception
47
+	 * @return \Illuminate\Http\Response
48
+	 */
49
+	public function render($request, Exception $exception)
50
+	{
51
+		if ($request->wantsJson()) {
52
+			if ($exception instanceof \Illuminate\Auth\AuthenticationException) {
53
+				\Errors::unAuthorized();
54
+			}
55
+			if ($exception instanceof \Illuminate\Database\QueryException) {
56
+				\Errors::dbQueryError();
57
+			} elseif ($exception instanceof \predis\connection\connectionexception) {
58
+				\Errors::redisNotRunning();
59
+			} elseif ($exception instanceof \GuzzleHttp\Exception\ClientException) {
60
+				\Errors::connectionError();
61
+			} elseif ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) {
62
+				$errors = $exception->getStatusCode() === 404 ? 'not found' : $exception->getMessage();
63
+				return \Response::json(['errors' => [$errors]], $exception->getStatusCode());
64
+			} elseif ($exception instanceof \Illuminate\Validation\ValidationException) {
65
+				return \Response::json(['errors' => $exception->errors()], 422);
66
+			} elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
67
+				return parent::render($request, $exception);
68
+			}
69
+		}
70 70
         
71
-        return parent::render($request, $exception);
72
-    }
71
+		return parent::render($request, $exception);
72
+	}
73 73
 }
Please login to merge, or discard this patch.
Core/Console/Commands/Stubs/Module/Http/Controllers/DummyController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use App\Modules\Core\BaseClasses\BaseApiController;
6 6
 use App\Modules\DummyModule\Services\DummyService;
7
-use App\Modules\Core\Utl\CoreConfig;
8 7
 use App\Modules\DummyModule\Http\Requests\InsertDummy;
9 8
 use App\Modules\DummyModule\Http\Requests\UpdateDummy;
10 9
 
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -10,57 +10,57 @@
 block discarded – undo
10 10
 
11 11
 class DummyController extends BaseApiController
12 12
 {
13
-    /**
14
-     * Path of the model resource
15
-     *
16
-     * @var string
17
-     */
18
-    protected $modelResource = 'App\Modules\DummyModule\Http\Resources\DummyModel';
13
+	/**
14
+	 * Path of the model resource
15
+	 *
16
+	 * @var string
17
+	 */
18
+	protected $modelResource = 'App\Modules\DummyModule\Http\Resources\DummyModel';
19 19
 
20
-    /**
21
-     * List of all route actions that the base api controller
22
-     * will skip permissions check for them.
23
-     * @var array
24
-     */
25
-    protected $skipPermissionCheck = [];
20
+	/**
21
+	 * List of all route actions that the base api controller
22
+	 * will skip permissions check for them.
23
+	 * @var array
24
+	 */
25
+	protected $skipPermissionCheck = [];
26 26
 
27
-    /**
28
-     * List of all route actions that the base api controller
29
-     * will skip login check for them.
30
-     * @var array
31
-     */
32
-    protected $skipLoginCheck = [];
27
+	/**
28
+	 * List of all route actions that the base api controller
29
+	 * will skip login check for them.
30
+	 * @var array
31
+	 */
32
+	protected $skipLoginCheck = [];
33 33
 
34
-    /**
35
-     * Init new object.
36
-     *
37
-     * @param   DummyService $service
38
-     * @return  void
39
-     */
40
-    public function __construct(DummyService $service)
41
-    {
42
-        parent::__construct($service);
43
-    }
34
+	/**
35
+	 * Init new object.
36
+	 *
37
+	 * @param   DummyService $service
38
+	 * @return  void
39
+	 */
40
+	public function __construct(DummyService $service)
41
+	{
42
+		parent::__construct($service);
43
+	}
44 44
 
45
-    /**
46
-     * Insert the given model to storage.
47
-     *
48
-     * @param InsertDummy $request
49
-     * @return \Illuminate\Http\Response
50
-     */
51
-    public function insert(InsertDummy $request)
52
-    {
53
-        return new $this->modelResource($this->service->save($request->all()));
54
-    }
45
+	/**
46
+	 * Insert the given model to storage.
47
+	 *
48
+	 * @param InsertDummy $request
49
+	 * @return \Illuminate\Http\Response
50
+	 */
51
+	public function insert(InsertDummy $request)
52
+	{
53
+		return new $this->modelResource($this->service->save($request->all()));
54
+	}
55 55
 
56
-    /**
57
-     * Update the given model to storage.
58
-     *
59
-     * @param UpdateDummy $request
60
-     * @return \Illuminate\Http\Response
61
-     */
62
-    public function update(UpdateDummy $request)
63
-    {
64
-        return new $this->modelResource($this->service->save($request->all()));
65
-    }
56
+	/**
57
+	 * Update the given model to storage.
58
+	 *
59
+	 * @param UpdateDummy $request
60
+	 * @return \Illuminate\Http\Response
61
+	 */
62
+	public function update(UpdateDummy $request)
63
+	{
64
+		return new $this->modelResource($this->service->save($request->all()));
65
+	}
66 66
 }
Please login to merge, or discard this patch.
files/Kernel.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -10,38 +10,38 @@
 block discarded – undo
10 10
 
11 11
 class Kernel extends ConsoleKernel
12 12
 {
13
-    /**
14
-     * The Artisan commands provided by your application.
15
-     *
16
-     * @var array
17
-     */
18
-    protected $commands = [
19
-        GenerateDoc::class,
20
-        MakeNotificationsCommand::class,
21
-        MakeModuleCommand::class
22
-    ];
13
+	/**
14
+	 * The Artisan commands provided by your application.
15
+	 *
16
+	 * @var array
17
+	 */
18
+	protected $commands = [
19
+		GenerateDoc::class,
20
+		MakeNotificationsCommand::class,
21
+		MakeModuleCommand::class
22
+	];
23 23
 
24
-    /**
25
-     * Define the application's command schedule.
26
-     *
27
-     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
28
-     * @return void
29
-     */
30
-    protected function schedule(Schedule $schedule)
31
-    {
32
-        // $schedule->command('inspire')
33
-        //          ->hourly();
34
-    }
24
+	/**
25
+	 * Define the application's command schedule.
26
+	 *
27
+	 * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
28
+	 * @return void
29
+	 */
30
+	protected function schedule(Schedule $schedule)
31
+	{
32
+		// $schedule->command('inspire')
33
+		//          ->hourly();
34
+	}
35 35
 
36
-    /**
37
-     * Register the commands for the application.
38
-     *
39
-     * @return void
40
-     */
41
-    protected function commands()
42
-    {
43
-        $this->load(__DIR__.'/Commands');
36
+	/**
37
+	 * Register the commands for the application.
38
+	 *
39
+	 * @return void
40
+	 */
41
+	protected function commands()
42
+	{
43
+		$this->load(__DIR__.'/Commands');
44 44
 
45
-        require base_path('routes/console.php');
46
-    }
45
+		require base_path('routes/console.php');
46
+	}
47 47
 }
Please login to merge, or discard this patch.
files/HttpKernel.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -6,81 +6,81 @@
 block discarded – undo
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
-        \App\Http\Middleware\TrustProxies::class,
18
-        \App\Http\Middleware\CheckForMaintenanceMode::class,
19
-        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
20
-        \App\Http\Middleware\TrimStrings::class,
21
-        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
22
-    ];
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
+		\App\Http\Middleware\TrustProxies::class,
18
+		\App\Http\Middleware\CheckForMaintenanceMode::class,
19
+		\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
20
+		\App\Http\Middleware\TrimStrings::class,
21
+		\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
22
+	];
23 23
 
24
-    /**
25
-     * The application's route middleware groups.
26
-     *
27
-     * @var array
28
-     */
29
-    protected $middlewareGroups = [
30
-        'web' => [
31
-            \App\Http\Middleware\EncryptCookies::class,
32
-            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
33
-            \Illuminate\Session\Middleware\StartSession::class,
34
-            // \Illuminate\Session\Middleware\AuthenticateSession::class,
35
-            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
36
-            \App\Http\Middleware\VerifyCsrfToken::class,
37
-            \Illuminate\Routing\Middleware\SubstituteBindings::class,
38
-        ],
24
+	/**
25
+	 * The application's route middleware groups.
26
+	 *
27
+	 * @var array
28
+	 */
29
+	protected $middlewareGroups = [
30
+		'web' => [
31
+			\App\Http\Middleware\EncryptCookies::class,
32
+			\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
33
+			\Illuminate\Session\Middleware\StartSession::class,
34
+			// \Illuminate\Session\Middleware\AuthenticateSession::class,
35
+			\Illuminate\View\Middleware\ShareErrorsFromSession::class,
36
+			\App\Http\Middleware\VerifyCsrfToken::class,
37
+			\Illuminate\Routing\Middleware\SubstituteBindings::class,
38
+		],
39 39
 
40
-        'api' => [
41
-            'throttle:60,1',
42
-            \Illuminate\Routing\Middleware\SubstituteBindings::class,
43
-            \App\Modules\Core\Http\Middleware\SetSessions::class,
44
-            \App\Modules\Core\Http\Middleware\CheckPermissions::class,
45
-            \App\Modules\Core\Http\Middleware\UpdateLocaleAndTimezone::class,
46
-            \App\Modules\Core\Http\Middleware\SetRelations::class,
47
-        ],
48
-    ];
40
+		'api' => [
41
+			'throttle:60,1',
42
+			\Illuminate\Routing\Middleware\SubstituteBindings::class,
43
+			\App\Modules\Core\Http\Middleware\SetSessions::class,
44
+			\App\Modules\Core\Http\Middleware\CheckPermissions::class,
45
+			\App\Modules\Core\Http\Middleware\UpdateLocaleAndTimezone::class,
46
+			\App\Modules\Core\Http\Middleware\SetRelations::class,
47
+		],
48
+	];
49 49
 
50
-    /**
51
-     * The application's route middleware.
52
-     *
53
-     * These middleware may be assigned to groups or used individually.
54
-     *
55
-     * @var array
56
-     */
57
-    protected $routeMiddleware = [
58
-        'auth' => \App\Http\Middleware\Authenticate::class,
59
-        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
60
-        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
61
-        'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
62
-        'can' => \Illuminate\Auth\Middleware\Authorize::class,
63
-        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
64
-        'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
65
-        'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
66
-        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
67
-        'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
68
-    ];
50
+	/**
51
+	 * The application's route middleware.
52
+	 *
53
+	 * These middleware may be assigned to groups or used individually.
54
+	 *
55
+	 * @var array
56
+	 */
57
+	protected $routeMiddleware = [
58
+		'auth' => \App\Http\Middleware\Authenticate::class,
59
+		'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
60
+		'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
61
+		'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
62
+		'can' => \Illuminate\Auth\Middleware\Authorize::class,
63
+		'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
64
+		'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
65
+		'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
66
+		'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
67
+		'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
68
+	];
69 69
 
70
-    /**
71
-     * The priority-sorted list of middleware.
72
-     *
73
-     * This forces non-global middleware to always be in the given order.
74
-     *
75
-     * @var array
76
-     */
77
-    protected $middlewarePriority = [
78
-        \Illuminate\Session\Middleware\StartSession::class,
79
-        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
80
-        \App\Http\Middleware\Authenticate::class,
81
-        \Illuminate\Routing\Middleware\ThrottleRequests::class,
82
-        \Illuminate\Session\Middleware\AuthenticateSession::class,
83
-        \Illuminate\Routing\Middleware\SubstituteBindings::class,
84
-        \Illuminate\Auth\Middleware\Authorize::class,
85
-    ];
70
+	/**
71
+	 * The priority-sorted list of middleware.
72
+	 *
73
+	 * This forces non-global middleware to always be in the given order.
74
+	 *
75
+	 * @var array
76
+	 */
77
+	protected $middlewarePriority = [
78
+		\Illuminate\Session\Middleware\StartSession::class,
79
+		\Illuminate\View\Middleware\ShareErrorsFromSession::class,
80
+		\App\Http\Middleware\Authenticate::class,
81
+		\Illuminate\Routing\Middleware\ThrottleRequests::class,
82
+		\Illuminate\Session\Middleware\AuthenticateSession::class,
83
+		\Illuminate\Routing\Middleware\SubstituteBindings::class,
84
+		\Illuminate\Auth\Middleware\Authorize::class,
85
+	];
86 86
 }
Please login to merge, or discard this patch.
files/channels.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,5 +12,5 @@
 block discarded – undo
12 12
 */
13 13
 
14 14
 Broadcast::channel('users.{id}', function ($user, $id) {
15
-    return (int) $user->id === (int) $id;
15
+	return (int) $user->id === (int) $id;
16 16
 });
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Broadcast::channel('users.{id}', function ($user, $id) {
14
+Broadcast::channel('users.{id}', function($user, $id) {
15 15
     return (int) $user->id === (int) $id;
16 16
 });
Please login to merge, or discard this patch.
files/auth.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 return [
4 4
 
5
-    /*
5
+	/*
6 6
     |--------------------------------------------------------------------------
7 7
     | Authentication Defaults
8 8
     |--------------------------------------------------------------------------
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
     |
14 14
     */
15 15
 
16
-    'defaults' => [
17
-        'guard' => 'web',
18
-        'passwords' => 'users',
19
-    ],
16
+	'defaults' => [
17
+		'guard' => 'web',
18
+		'passwords' => 'users',
19
+	],
20 20
 
21
-    /*
21
+	/*
22 22
     |--------------------------------------------------------------------------
23 23
     | Authentication Guards
24 24
     |--------------------------------------------------------------------------
@@ -35,19 +35,19 @@  discard block
 block discarded – undo
35 35
     |
36 36
     */
37 37
 
38
-    'guards' => [
39
-        'web' => [
40
-            'driver' => 'session',
41
-            'provider' => 'users',
42
-        ],
38
+	'guards' => [
39
+		'web' => [
40
+			'driver' => 'session',
41
+			'provider' => 'users',
42
+		],
43 43
 
44
-        'api' => [
45
-            'driver' => 'passport',
46
-            'provider' => 'users',
47
-        ],
48
-    ],
44
+		'api' => [
45
+			'driver' => 'passport',
46
+			'provider' => 'users',
47
+		],
48
+	],
49 49
 
50
-    /*
50
+	/*
51 51
     |--------------------------------------------------------------------------
52 52
     | User Providers
53 53
     |--------------------------------------------------------------------------
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
     |
65 65
     */
66 66
 
67
-    'providers' => [
68
-        'users' => [
69
-            'driver' => 'eloquent',
70
-            'model' => App\Modules\Users\AclUser::class,
71
-        ],
67
+	'providers' => [
68
+		'users' => [
69
+			'driver' => 'eloquent',
70
+			'model' => App\Modules\Users\AclUser::class,
71
+		],
72 72
 
73
-        // 'users' => [
74
-        //     'driver' => 'database',
75
-        //     'table' => 'users',
76
-        // ],
77
-    ],
73
+		// 'users' => [
74
+		//     'driver' => 'database',
75
+		//     'table' => 'users',
76
+		// ],
77
+	],
78 78
 
79
-    /*
79
+	/*
80 80
     |--------------------------------------------------------------------------
81 81
     | Resetting Passwords
82 82
     |--------------------------------------------------------------------------
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
     |
92 92
     */
93 93
 
94
-    'passwords' => [
95
-        'users' => [
96
-            'provider' => 'users',
97
-            'table' => 'password_resets',
98
-            'expire' => 60,
99
-        ],
100
-    ],
94
+	'passwords' => [
95
+		'users' => [
96
+			'provider' => 'users',
97
+			'table' => 'password_resets',
98
+			'expire' => 60,
99
+		],
100
+	],
101 101
 
102 102
 ];
Please login to merge, or discard this patch.
files/AuthServiceProvider.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,31 +7,31 @@
 block discarded – undo
7 7
 
8 8
 class AuthServiceProvider extends ServiceProvider
9 9
 {
10
-    /**
11
-     * The policy mappings for the application.
12
-     *
13
-     * @var array
14
-     */
15
-    protected $policies = [
16
-        'App\Model' => 'App\Policies\ModelPolicy',
17
-    ];
10
+	/**
11
+	 * The policy mappings for the application.
12
+	 *
13
+	 * @var array
14
+	 */
15
+	protected $policies = [
16
+		'App\Model' => 'App\Policies\ModelPolicy',
17
+	];
18 18
 
19
-    /**
20
-     * Register any authentication / authorization services.
21
-     *
22
-     * @return void
23
-     */
24
-    public function boot()
25
-    {
26
-        $this->registerPolicies();
19
+	/**
20
+	 * Register any authentication / authorization services.
21
+	 *
22
+	 * @return void
23
+	 */
24
+	public function boot()
25
+	{
26
+		$this->registerPolicies();
27 27
 
28
-        Passport::routes(function ($router) {
29
-            $router->forAuthorization();
30
-            $router->forAccessTokens();
31
-            $router->forPersonalAccessTokens();
32
-            $router->forTransientTokens();
33
-        });
34
-        Passport::tokensExpireIn(\Carbon\Carbon::now()->addMinutes(10));
35
-        Passport::refreshTokensExpireIn(\Carbon\Carbon::now()->addDays(10));
36
-    }
28
+		Passport::routes(function ($router) {
29
+			$router->forAuthorization();
30
+			$router->forAccessTokens();
31
+			$router->forPersonalAccessTokens();
32
+			$router->forTransientTokens();
33
+		});
34
+		Passport::tokensExpireIn(\Carbon\Carbon::now()->addMinutes(10));
35
+		Passport::refreshTokensExpireIn(\Carbon\Carbon::now()->addDays(10));
36
+	}
37 37
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     {
26 26
         $this->registerPolicies();
27 27
 
28
-        Passport::routes(function ($router) {
28
+        Passport::routes(function($router) {
29 29
             $router->forAuthorization();
30 30
             $router->forAccessTokens();
31 31
             $router->forPersonalAccessTokens();
Please login to merge, or discard this patch.
config/skeleton.php 1 patch
Indentation   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 return [
4 4
 
5
-    /*
5
+	/*
6 6
     |--------------------------------------------------------------------------
7 7
     | Disable Confirm Email
8 8
     |--------------------------------------------------------------------------
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
     |
12 12
     */
13 13
 
14
-    'disable_confirm_email' => env('DISABLE_CONFIRM_EMAIL', false),
14
+	'disable_confirm_email' => env('DISABLE_CONFIRM_EMAIL', false),
15 15
 
16
-    /*
16
+	/*
17 17
     |--------------------------------------------------------------------------
18 18
     | Confirm Email URL
19 19
     |--------------------------------------------------------------------------
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
     |
23 23
     */
24 24
    
25
-    'confrim_email_url' => env('CONFIRM_EMAIL_URL'),
25
+	'confrim_email_url' => env('CONFIRM_EMAIL_URL'),
26 26
 
27
-    /*
27
+	/*
28 28
     |--------------------------------------------------------------------------
29 29
     | Reset Password URL
30 30
     |--------------------------------------------------------------------------
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
     |
34 34
     */
35 35
    
36
-    'reset_password_url' => env('RESET_PASSWORD_URL'),
36
+	'reset_password_url' => env('RESET_PASSWORD_URL'),
37 37
 
38
-    /*
38
+	/*
39 39
     |--------------------------------------------------------------------------
40 40
     | Passport Client Id
41 41
     |--------------------------------------------------------------------------
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
     |
45 45
     */
46 46
    
47
-    'passport_client_id' => env('PASSWORD_CLIENT_ID'),
47
+	'passport_client_id' => env('PASSWORD_CLIENT_ID'),
48 48
 
49
-    /*
49
+	/*
50 50
     |--------------------------------------------------------------------------
51 51
     | Passport Client Secret
52 52
     |--------------------------------------------------------------------------
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
     |
56 56
     */
57 57
    
58
-    'passport_client_secret' => env('PASSWORD_CLIENT_SECRET'),
58
+	'passport_client_secret' => env('PASSWORD_CLIENT_SECRET'),
59 59
 
60
-    /*
60
+	/*
61 61
     |--------------------------------------------------------------------------
62 62
     | Social Pass
63 63
     |--------------------------------------------------------------------------
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     |
67 67
     */
68 68
 
69
-    'social_pass' => env('SOCIAL_PASS', false),
69
+	'social_pass' => env('SOCIAL_PASS', false),
70 70
 
71
-    /*
71
+	/*
72 72
     |--------------------------------------------------------------------------
73 73
     | Relations Between Models
74 74
     |--------------------------------------------------------------------------
@@ -77,88 +77,88 @@  discard block
 block discarded – undo
77 77
     |
78 78
     */
79 79
     
80
-    'relations' => [
81
-        'user' => [
82
-            'list'       => [],
83
-            'find'       => [],
84
-            'findby'     => [],
85
-            'paginate'   => [],
86
-            'paginateby' => [],
87
-            'first'      => [],
88
-            'search'     => [],
89
-            'account'    => [],
90
-            'group'      => [],
91
-            'deleted'    => [],
92
-        ],
93
-        'permission' => [
94
-            'list'       => [],
95
-            'find'       => [],
96
-            'findby'     => [],
97
-            'paginate'   => [],
98
-            'paginateby' => [],
99
-            'first'      => [],
100
-            'search'     => [],
101
-            'deleted'    => [],
102
-        ],
103
-        'group' => [
104
-            'list'       => [],
105
-            'find'       => [],
106
-            'findby'     => [],
107
-            'paginate'   => [],
108
-            'paginateby' => [],
109
-            'first'      => [],
110
-            'search'     => [],
111
-            'deleted'    => [],
112
-        ],
113
-        'oauthClient' => [
114
-            'list'       => [],
115
-            'find'       => [],
116
-            'findby'     => [],
117
-            'paginate'   => [],
118
-            'paginateby' => [],
119
-            'first'      => [],
120
-            'search'     => [],
121
-            'account'    => [],
122
-            'group'      => [],
123
-            'deleted'    => [],
124
-        ],
125
-        'notification' => [
126
-            'list'   => [],
127
-            'unread' => [],
128
-        ],
129
-        'pushNotificationDevice' => [
130
-            'list'       => [],
131
-            'find'       => [],
132
-            'findby'     => [],
133
-            'paginate'   => [],
134
-            'paginateby' => [],
135
-            'first'      => [],
136
-            'search'     => [],
137
-            'deleted'    => [],
138
-        ],
139
-        'report' => [
140
-            'list'       => [],
141
-            'find'       => [],
142
-            'findby'     => [],
143
-            'paginate'   => [],
144
-            'paginateby' => [],
145
-            'first'      => [],
146
-            'search'     => [],
147
-            'deleted'    => [],
148
-        ],
149
-        'setting' => [
150
-            'list'       => [],
151
-            'find'       => [],
152
-            'findby'     => [],
153
-            'paginate'   => [],
154
-            'paginateby' => [],
155
-            'first'      => [],
156
-            'search'     => [],
157
-            'deleted'    => [],
158
-        ]
159
-    ],
80
+	'relations' => [
81
+		'user' => [
82
+			'list'       => [],
83
+			'find'       => [],
84
+			'findby'     => [],
85
+			'paginate'   => [],
86
+			'paginateby' => [],
87
+			'first'      => [],
88
+			'search'     => [],
89
+			'account'    => [],
90
+			'group'      => [],
91
+			'deleted'    => [],
92
+		],
93
+		'permission' => [
94
+			'list'       => [],
95
+			'find'       => [],
96
+			'findby'     => [],
97
+			'paginate'   => [],
98
+			'paginateby' => [],
99
+			'first'      => [],
100
+			'search'     => [],
101
+			'deleted'    => [],
102
+		],
103
+		'group' => [
104
+			'list'       => [],
105
+			'find'       => [],
106
+			'findby'     => [],
107
+			'paginate'   => [],
108
+			'paginateby' => [],
109
+			'first'      => [],
110
+			'search'     => [],
111
+			'deleted'    => [],
112
+		],
113
+		'oauthClient' => [
114
+			'list'       => [],
115
+			'find'       => [],
116
+			'findby'     => [],
117
+			'paginate'   => [],
118
+			'paginateby' => [],
119
+			'first'      => [],
120
+			'search'     => [],
121
+			'account'    => [],
122
+			'group'      => [],
123
+			'deleted'    => [],
124
+		],
125
+		'notification' => [
126
+			'list'   => [],
127
+			'unread' => [],
128
+		],
129
+		'pushNotificationDevice' => [
130
+			'list'       => [],
131
+			'find'       => [],
132
+			'findby'     => [],
133
+			'paginate'   => [],
134
+			'paginateby' => [],
135
+			'first'      => [],
136
+			'search'     => [],
137
+			'deleted'    => [],
138
+		],
139
+		'report' => [
140
+			'list'       => [],
141
+			'find'       => [],
142
+			'findby'     => [],
143
+			'paginate'   => [],
144
+			'paginateby' => [],
145
+			'first'      => [],
146
+			'search'     => [],
147
+			'deleted'    => [],
148
+		],
149
+		'setting' => [
150
+			'list'       => [],
151
+			'find'       => [],
152
+			'findby'     => [],
153
+			'paginate'   => [],
154
+			'paginateby' => [],
155
+			'first'      => [],
156
+			'search'     => [],
157
+			'deleted'    => [],
158
+		]
159
+	],
160 160
 
161
-    /*
161
+	/*
162 162
     |--------------------------------------------------------------------------
163 163
     | Cache Configurations
164 164
     |--------------------------------------------------------------------------
@@ -167,46 +167,46 @@  discard block
 block discarded – undo
167 167
     |
168 168
     */
169 169
 
170
-    'cache_config' => [
171
-        'oauthClient' => [
172
-            'cache' => [
173
-                'all',
174
-                'find',
175
-                'findBy',
176
-                'paginate',
177
-                'paginateBy',
178
-                'first',
179
-                'search',
180
-                'deleted'
181
-            ],
182
-            'clear' => [
183
-                'update'           => ['oauthClients', 'users', 'groups'],
184
-                'save'             => ['oauthClients', 'users', 'groups'],
185
-                'delete'           => ['oauthClients', 'users', 'groups'],
186
-                'restore'          => ['oauthClients', 'users', 'groups'],
187
-                'revoke'           => ['oauthClients', 'users', 'groups'],
188
-                'ubRevoke'         => ['oauthClients', 'users', 'groups'],
189
-                'regenerateSecret' => ['oauthClients', 'users', 'groups'],
190
-            ],
191
-        ],
192
-        'setting' => [
193
-            'cache' => [
194
-                'all',
195
-                'find',
196
-                'findBy',
197
-                'paginate',
198
-                'paginateBy',
199
-                'first',
200
-                'search',
201
-                'deleted'
202
-            ],
203
-            'clear' => [
204
-                'update'   => ['settings'],
205
-                'save'     => ['settings'],
206
-                'delete'   => ['settings'],
207
-                'restore'  => ['settings'],
208
-                'saveMany' => ['settings'],
209
-            ]
210
-        ]
211
-    ]
170
+	'cache_config' => [
171
+		'oauthClient' => [
172
+			'cache' => [
173
+				'all',
174
+				'find',
175
+				'findBy',
176
+				'paginate',
177
+				'paginateBy',
178
+				'first',
179
+				'search',
180
+				'deleted'
181
+			],
182
+			'clear' => [
183
+				'update'           => ['oauthClients', 'users', 'groups'],
184
+				'save'             => ['oauthClients', 'users', 'groups'],
185
+				'delete'           => ['oauthClients', 'users', 'groups'],
186
+				'restore'          => ['oauthClients', 'users', 'groups'],
187
+				'revoke'           => ['oauthClients', 'users', 'groups'],
188
+				'ubRevoke'         => ['oauthClients', 'users', 'groups'],
189
+				'regenerateSecret' => ['oauthClients', 'users', 'groups'],
190
+			],
191
+		],
192
+		'setting' => [
193
+			'cache' => [
194
+				'all',
195
+				'find',
196
+				'findBy',
197
+				'paginate',
198
+				'paginateBy',
199
+				'first',
200
+				'search',
201
+				'deleted'
202
+			],
203
+			'clear' => [
204
+				'update'   => ['settings'],
205
+				'save'     => ['settings'],
206
+				'delete'   => ['settings'],
207
+				'restore'  => ['settings'],
208
+				'saveMany' => ['settings'],
209
+			]
210
+		]
211
+	]
212 212
 ];
Please login to merge, or discard this patch.
src/Modules/Core/Http/Middleware/CheckPermissions.php 2 patches
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -11,68 +11,68 @@
 block discarded – undo
11 11
 
12 12
 class CheckPermissions
13 13
 {
14
-    protected $route;
15
-    protected $auth;
16
-    protected $authMiddleware;
17
-    protected $userService;
18
-    protected $arr;
14
+	protected $route;
15
+	protected $auth;
16
+	protected $authMiddleware;
17
+	protected $userService;
18
+	protected $arr;
19 19
     
20
-    /**
21
-     * Init new object.
22
-     *
23
-     * @param   Route          $route
24
-     * @param   Auth           $auth
25
-     * @param   AuthMiddleware $authMiddleware
26
-     * @param   UserService    $userService
27
-     * @param   Arr            $arr
28
-     *
29
-     * @return  void
30
-     */
31
-    public function __construct(Route $route, Auth $auth, AuthMiddleware $authMiddleware, UserService $userService, Arr $arr)
32
-    {
33
-        $this->route = $route;
34
-        $this->auth = $auth;
35
-        $this->authMiddleware = $authMiddleware;
36
-        $this->userService = $userService;
37
-        $this->arr = $arr;
38
-    }
20
+	/**
21
+	 * Init new object.
22
+	 *
23
+	 * @param   Route          $route
24
+	 * @param   Auth           $auth
25
+	 * @param   AuthMiddleware $authMiddleware
26
+	 * @param   UserService    $userService
27
+	 * @param   Arr            $arr
28
+	 *
29
+	 * @return  void
30
+	 */
31
+	public function __construct(Route $route, Auth $auth, AuthMiddleware $authMiddleware, UserService $userService, Arr $arr)
32
+	{
33
+		$this->route = $route;
34
+		$this->auth = $auth;
35
+		$this->authMiddleware = $authMiddleware;
36
+		$this->userService = $userService;
37
+		$this->arr = $arr;
38
+	}
39 39
 
40
-    /**
41
-     * Handle an incoming request.
42
-     *
43
-     * @param  \Illuminate\Http\Request  $request
44
-     * @param  \Closure  $next
45
-     * @return mixed
46
-     */
47
-    public function handle($request, Closure $next)
48
-    {
49
-        $routeActions        = explode('@', $this->route->currentRouteAction());
50
-        $reflectionClass     = new \ReflectionClass($routeActions[0]);
51
-        $classProperties     = $reflectionClass->getDefaultProperties();
52
-        $skipPermissionCheck = $this->arr->get($classProperties, 'skipPermissionCheck', []);
53
-        $skipLoginCheck      = $this->arr->get($classProperties, 'skipLoginCheck', []);
54
-        $modelName           = explode('\\', $routeActions[0]);
55
-        $modelName           = lcfirst(str_replace('Controller', '', end($modelName)));
56
-        $permission          = $routeActions[1];
40
+	/**
41
+	 * Handle an incoming request.
42
+	 *
43
+	 * @param  \Illuminate\Http\Request  $request
44
+	 * @param  \Closure  $next
45
+	 * @return mixed
46
+	 */
47
+	public function handle($request, Closure $next)
48
+	{
49
+		$routeActions        = explode('@', $this->route->currentRouteAction());
50
+		$reflectionClass     = new \ReflectionClass($routeActions[0]);
51
+		$classProperties     = $reflectionClass->getDefaultProperties();
52
+		$skipPermissionCheck = $this->arr->get($classProperties, 'skipPermissionCheck', []);
53
+		$skipLoginCheck      = $this->arr->get($classProperties, 'skipLoginCheck', []);
54
+		$modelName           = explode('\\', $routeActions[0]);
55
+		$modelName           = lcfirst(str_replace('Controller', '', end($modelName)));
56
+		$permission          = $routeActions[1];
57 57
 
58
-        $this->auth->shouldUse('api');
59
-        if (! in_array($permission, $skipLoginCheck)) {
60
-            $this->authMiddleware->handle($request, function ($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) {
61
-                $user             = $this->auth->user();
62
-                $isPasswordClient = $user->token()->client->password_client;
58
+		$this->auth->shouldUse('api');
59
+		if (! in_array($permission, $skipLoginCheck)) {
60
+			$this->authMiddleware->handle($request, function ($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) {
61
+				$user             = $this->auth->user();
62
+				$isPasswordClient = $user->token()->client->password_client;
63 63
     
64
-                if ($user->blocked) {
65
-                    \Errors::userIsBlocked();
66
-                }
64
+				if ($user->blocked) {
65
+					\Errors::userIsBlocked();
66
+				}
67 67
     
68
-                if ($isPasswordClient && (in_array($permission, $skipPermissionCheck) || $this->userService->can($permission, $modelName))) {
69
-                } elseif (! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) {
70
-                } else {
71
-                    \Errors::noPermissions();
72
-                }
73
-            });
74
-        }
68
+				if ($isPasswordClient && (in_array($permission, $skipPermissionCheck) || $this->userService->can($permission, $modelName))) {
69
+				} elseif (! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) {
70
+				} else {
71
+					\Errors::noPermissions();
72
+				}
73
+			});
74
+		}
75 75
 
76
-        return $next($request);
77
-    }
76
+		return $next($request);
77
+	}
78 78
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
         $permission          = $routeActions[1];
57 57
 
58 58
         $this->auth->shouldUse('api');
59
-        if (! in_array($permission, $skipLoginCheck)) {
60
-            $this->authMiddleware->handle($request, function ($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) {
59
+        if ( ! in_array($permission, $skipLoginCheck)) {
60
+            $this->authMiddleware->handle($request, function($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) {
61 61
                 $user             = $this->auth->user();
62 62
                 $isPasswordClient = $user->token()->client->password_client;
63 63
     
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                 }
67 67
     
68 68
                 if ($isPasswordClient && (in_array($permission, $skipPermissionCheck) || $this->userService->can($permission, $modelName))) {
69
-                } elseif (! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) {
69
+                } elseif ( ! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) {
70 70
                 } else {
71 71
                     \Errors::noPermissions();
72 72
                 }
Please login to merge, or discard this patch.