@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -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', 'permissions'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'permissions'); |
|
9 | + /** |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'permissions'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'permissions'); |
|
18 | 18 | |
19 | - $this->loadMigrationsFrom(module_path('permissions', 'Database/Migrations', 'app')); |
|
20 | - $this->loadFactoriesFrom(module_path('permissions', 'Database/Factories', 'app')); |
|
21 | - if (!$this->app->configurationIsCached()) { |
|
22 | - $this->loadConfigsFrom(module_path('permissions', 'Config', 'app')); |
|
23 | - } |
|
24 | - } |
|
19 | + $this->loadMigrationsFrom(module_path('permissions', 'Database/Migrations', 'app')); |
|
20 | + $this->loadFactoriesFrom(module_path('permissions', 'Database/Factories', 'app')); |
|
21 | + if (!$this->app->configurationIsCached()) { |
|
22 | + $this->loadConfigsFrom(module_path('permissions', '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 | } |
@@ -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', 'users'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'users'); |
|
9 | + /** |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'users'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'users'); |
|
18 | 18 | |
19 | - $this->loadMigrationsFrom(module_path('users', 'Database/Migrations', 'app')); |
|
20 | - $this->loadFactoriesFrom(module_path('users', 'Database/Factories', 'app')); |
|
21 | - if (!$this->app->configurationIsCached()) { |
|
22 | - $this->loadConfigsFrom(module_path('users', 'Config', 'app')); |
|
23 | - } |
|
24 | - } |
|
19 | + $this->loadMigrationsFrom(module_path('users', 'Database/Migrations', 'app')); |
|
20 | + $this->loadFactoriesFrom(module_path('users', 'Database/Factories', 'app')); |
|
21 | + if (!$this->app->configurationIsCached()) { |
|
22 | + $this->loadConfigsFrom(module_path('users', '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 | } |
@@ -7,69 +7,69 @@ |
||
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 | - * @param \Throwable $exception |
|
33 | - * @return void |
|
34 | - * |
|
35 | - * @throws \Exception |
|
36 | - */ |
|
37 | - public function report(Throwable $exception) |
|
38 | - { |
|
39 | - parent::report($exception); |
|
40 | - } |
|
29 | + /** |
|
30 | + * Report or log an exception. |
|
31 | + * |
|
32 | + * @param \Throwable $exception |
|
33 | + * @return void |
|
34 | + * |
|
35 | + * @throws \Exception |
|
36 | + */ |
|
37 | + public function report(Throwable $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 \Throwable $exception |
|
47 | - * @return \Symfony\Component\HttpFoundation\Response |
|
48 | - * |
|
49 | - * @throws \Throwable |
|
50 | - */ |
|
51 | - public function render($request, Throwable $exception) |
|
52 | - { |
|
53 | - if ($request->wantsJson()) { |
|
54 | - if ($exception instanceof \Illuminate\Auth\AuthenticationException) { |
|
55 | - \Errors::unAuthorized(); |
|
56 | - } |
|
57 | - if ($exception instanceof \Illuminate\Database\QueryException) { |
|
58 | - \Errors::dbQueryError(); |
|
59 | - } elseif ($exception instanceof \predis\connection\connectionexception) { |
|
60 | - \Errors::redisNotRunning(); |
|
61 | - } elseif ($exception instanceof \GuzzleHttp\Exception\ClientException) { |
|
62 | - \Errors::connectionError(); |
|
63 | - } elseif ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { |
|
64 | - $errors = $exception-> getStatusCode() === 404 ? 'not found' : $exception-> getMessage(); |
|
65 | - return \Response::json(['errors' => [$errors]], $exception-> getStatusCode()); |
|
66 | - } elseif ($exception instanceof \Illuminate\Validation\ValidationException) { |
|
67 | - return \Response::json(['errors' => $exception-> errors()], 422); |
|
68 | - } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) { |
|
69 | - return parent::render($request, $exception); |
|
70 | - } |
|
71 | - } |
|
42 | + /** |
|
43 | + * Render an exception into an HTTP response. |
|
44 | + * |
|
45 | + * @param \Illuminate\Http\Request $request |
|
46 | + * @param \Throwable $exception |
|
47 | + * @return \Symfony\Component\HttpFoundation\Response |
|
48 | + * |
|
49 | + * @throws \Throwable |
|
50 | + */ |
|
51 | + public function render($request, Throwable $exception) |
|
52 | + { |
|
53 | + if ($request->wantsJson()) { |
|
54 | + if ($exception instanceof \Illuminate\Auth\AuthenticationException) { |
|
55 | + \Errors::unAuthorized(); |
|
56 | + } |
|
57 | + if ($exception instanceof \Illuminate\Database\QueryException) { |
|
58 | + \Errors::dbQueryError(); |
|
59 | + } elseif ($exception instanceof \predis\connection\connectionexception) { |
|
60 | + \Errors::redisNotRunning(); |
|
61 | + } elseif ($exception instanceof \GuzzleHttp\Exception\ClientException) { |
|
62 | + \Errors::connectionError(); |
|
63 | + } elseif ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { |
|
64 | + $errors = $exception-> getStatusCode() === 404 ? 'not found' : $exception-> getMessage(); |
|
65 | + return \Response::json(['errors' => [$errors]], $exception-> getStatusCode()); |
|
66 | + } elseif ($exception instanceof \Illuminate\Validation\ValidationException) { |
|
67 | + return \Response::json(['errors' => $exception-> errors()], 422); |
|
68 | + } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) { |
|
69 | + return parent::render($request, $exception); |
|
70 | + } |
|
71 | + } |
|
72 | 72 | |
73 | - return parent::render($request, $exception); |
|
74 | - } |
|
73 | + return parent::render($request, $exception); |
|
74 | + } |
|
75 | 75 | } |
@@ -7,31 +7,31 @@ |
||
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(60)); |
|
35 | - Passport::refreshTokensExpireIn(\Carbon\Carbon::now()->addMinutes(14400)); |
|
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(60)); |
|
35 | + Passport::refreshTokensExpireIn(\Carbon\Carbon::now()->addMinutes(14400)); |
|
36 | + } |
|
37 | 37 | } |
@@ -9,16 +9,16 @@ |
||
9 | 9 | class Report extends Model |
10 | 10 | { |
11 | 11 | |
12 | - use SoftDeletes; |
|
13 | - protected $table = 'reports'; |
|
14 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
15 | - protected $hidden = ['deleted_at']; |
|
16 | - protected $guarded = ['id']; |
|
17 | - public $fillable = ['report_name', 'view_name']; |
|
12 | + use SoftDeletes; |
|
13 | + protected $table = 'reports'; |
|
14 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
15 | + protected $hidden = ['deleted_at']; |
|
16 | + protected $guarded = ['id']; |
|
17 | + public $fillable = ['report_name', 'view_name']; |
|
18 | 18 | |
19 | - public static function boot() |
|
20 | - { |
|
21 | - parent::boot(); |
|
22 | - Report::observe(ReportObserver::class); |
|
23 | - } |
|
19 | + public static function boot() |
|
20 | + { |
|
21 | + parent::boot(); |
|
22 | + Report::observe(ReportObserver::class); |
|
23 | + } |
|
24 | 24 | } |
@@ -5,29 +5,29 @@ |
||
5 | 5 | |
6 | 6 | class Reports extends Migration |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('reports', function (Blueprint $table) { |
|
16 | - increments('id'); |
|
17 | - $table->string('report_name', 100); |
|
18 | - $table->string('view_name', 100); |
|
19 | - $table->softDeletes(); |
|
20 | - $table->timestamps(); |
|
21 | - }); |
|
22 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('reports', function (Blueprint $table) { |
|
16 | + increments('id'); |
|
17 | + $table->string('report_name', 100); |
|
18 | + $table->string('view_name', 100); |
|
19 | + $table->softDeletes(); |
|
20 | + $table->timestamps(); |
|
21 | + }); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * Reverse the migrations. |
|
26 | - * |
|
27 | - * @return void |
|
28 | - */ |
|
29 | - public function down() |
|
30 | - { |
|
31 | - Schema::dropIfExists('reports'); |
|
32 | - } |
|
24 | + /** |
|
25 | + * Reverse the migrations. |
|
26 | + * |
|
27 | + * @return void |
|
28 | + */ |
|
29 | + public function down() |
|
30 | + { |
|
31 | + Schema::dropIfExists('reports'); |
|
32 | + } |
|
33 | 33 | } |