@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * Here goes your notification messages. |
|
7 | - */ |
|
5 | + /** |
|
6 | + * Here goes your notification messages. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | ]; |
10 | 10 | \ No newline at end of file |
@@ -4,39 +4,39 @@ |
||
4 | 4 | |
5 | 5 | abstract class AbstractRepositoryContainer implements RepositoryContainerInterface |
6 | 6 | { |
7 | - /** |
|
8 | - * Construct the repository class name based on |
|
9 | - * the method name called, search in the |
|
10 | - * given namespaces for the class and |
|
11 | - * return an instance. |
|
12 | - * |
|
13 | - * @param string $name the called method name |
|
14 | - * @param array $arguments the method arguments |
|
15 | - * @return object |
|
16 | - */ |
|
17 | - public function __call($name, $arguments) |
|
18 | - { |
|
19 | - foreach ($this->getRepoNameSpace() as $repoNameSpace) |
|
20 | - { |
|
21 | - $class = rtrim($repoNameSpace, '\\') . '\\' . ucfirst(str_singular($name)) . 'Repository'; |
|
22 | - if (class_exists($class)) |
|
23 | - { |
|
24 | - \App::singleton($class, function ($app) use ($class) { |
|
7 | + /** |
|
8 | + * Construct the repository class name based on |
|
9 | + * the method name called, search in the |
|
10 | + * given namespaces for the class and |
|
11 | + * return an instance. |
|
12 | + * |
|
13 | + * @param string $name the called method name |
|
14 | + * @param array $arguments the method arguments |
|
15 | + * @return object |
|
16 | + */ |
|
17 | + public function __call($name, $arguments) |
|
18 | + { |
|
19 | + foreach ($this->getRepoNameSpace() as $repoNameSpace) |
|
20 | + { |
|
21 | + $class = rtrim($repoNameSpace, '\\') . '\\' . ucfirst(str_singular($name)) . 'Repository'; |
|
22 | + if (class_exists($class)) |
|
23 | + { |
|
24 | + \App::singleton($class, function ($app) use ($class) { |
|
25 | 25 | |
26 | - return new \App\Modules\V1\Core\Decorators\CachingDecorator(new $class, $app['cache.store']); |
|
27 | - }); |
|
26 | + return new \App\Modules\V1\Core\Decorators\CachingDecorator(new $class, $app['cache.store']); |
|
27 | + }); |
|
28 | 28 | |
29 | - return \App::make($class); |
|
30 | - } |
|
31 | - } |
|
32 | - } |
|
29 | + return \App::make($class); |
|
30 | + } |
|
31 | + } |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Abstract methods that return the necessary |
|
36 | - * information (repositories namespaces) |
|
37 | - * needed to preform the previous actions. |
|
38 | - * |
|
39 | - * @return array |
|
40 | - */ |
|
41 | - abstract protected function getRepoNameSpace(); |
|
34 | + /** |
|
35 | + * Abstract methods that return the necessary |
|
36 | + * information (repositories namespaces) |
|
37 | + * needed to preform the previous actions. |
|
38 | + * |
|
39 | + * @return array |
|
40 | + */ |
|
41 | + abstract protected function getRepoNameSpace(); |
|
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -18,10 +18,10 @@ |
||
18 | 18 | { |
19 | 19 | foreach ($this->getRepoNameSpace() as $repoNameSpace) |
20 | 20 | { |
21 | - $class = rtrim($repoNameSpace, '\\') . '\\' . ucfirst(str_singular($name)) . 'Repository'; |
|
21 | + $class = rtrim($repoNameSpace, '\\').'\\'.ucfirst(str_singular($name)).'Repository'; |
|
22 | 22 | if (class_exists($class)) |
23 | 23 | { |
24 | - \App::singleton($class, function ($app) use ($class) { |
|
24 | + \App::singleton($class, function($app) use ($class) { |
|
25 | 25 | |
26 | 26 | return new \App\Modules\V1\Core\Decorators\CachingDecorator(new $class, $app['cache.store']); |
27 | 27 | }); |
@@ -13,13 +13,13 @@ |
||
13 | 13 | public function up() |
14 | 14 | { |
15 | 15 | Schema::create('settings', function (Blueprint $table) { |
16 | - $table->increments('id'); |
|
17 | - $table->string('name',100); |
|
18 | - $table->string('key',100)->unique(); |
|
19 | - $table->text('value')->nullable(); |
|
20 | - $table->softDeletes(); |
|
21 | - $table->timestamps(); |
|
22 | - }); |
|
16 | + $table->increments('id'); |
|
17 | + $table->string('name',100); |
|
18 | + $table->string('key',100)->unique(); |
|
19 | + $table->text('value')->nullable(); |
|
20 | + $table->softDeletes(); |
|
21 | + $table->timestamps(); |
|
22 | + }); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -12,10 +12,10 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('settings', function (Blueprint $table) { |
|
15 | + Schema::create('settings', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | - $table->string('name',100); |
|
18 | - $table->string('key',100)->unique(); |
|
17 | + $table->string('name', 100); |
|
18 | + $table->string('key', 100)->unique(); |
|
19 | 19 | $table->text('value')->nullable(); |
20 | 20 | $table->softDeletes(); |
21 | 21 | $table->timestamps(); |
@@ -7,26 +7,26 @@ |
||
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | 9 | /** |
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'reporting'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'reporting'); |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'reporting'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'reporting'); |
|
18 | 18 | |
19 | - $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | - $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | - } |
|
19 | + $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | + $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Register the module services. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function register() |
|
29 | - { |
|
30 | - $this->app->register(RouteServiceProvider::class); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Register the module services. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function register() |
|
29 | + { |
|
30 | + $this->app->register(RouteServiceProvider::class); |
|
31 | + } |
|
32 | 32 | } |
@@ -7,26 +7,26 @@ |
||
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | 9 | /** |
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'notification'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'notification'); |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'notification'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'notification'); |
|
18 | 18 | |
19 | - $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | - $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | - } |
|
19 | + $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | + $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Register the module services. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function register() |
|
29 | - { |
|
30 | - $this->app->register(RouteServiceProvider::class); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Register the module services. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function register() |
|
29 | + { |
|
30 | + $this->app->register(RouteServiceProvider::class); |
|
31 | + } |
|
32 | 32 | } |
@@ -6,27 +6,27 @@ |
||
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', 'acl'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'acl'); |
|
9 | + /** |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'acl'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'acl'); |
|
18 | 18 | |
19 | - $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | - $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | - } |
|
19 | + $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | + $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Register the module services. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function register() |
|
29 | - { |
|
30 | - $this->app->register(RouteServiceProvider::class); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Register the module services. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function register() |
|
29 | + { |
|
30 | + $this->app->register(RouteServiceProvider::class); |
|
31 | + } |
|
32 | 32 | } |
@@ -6,15 +6,15 @@ |
||
6 | 6 | |
7 | 7 | class ClearDataSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
17 | - \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
18 | - $permissions->delete(); |
|
19 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
17 | + \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
18 | + $permissions->delete(); |
|
19 | + } |
|
20 | 20 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function run() |
15 | 15 | { |
16 | - $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
16 | + $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
17 | 17 | \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
18 | 18 | $permissions->delete(); |
19 | 19 | } |
@@ -6,88 +6,88 @@ |
||
6 | 6 | |
7 | 7 | class PushNotificationsDevicesTableSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - /** |
|
17 | - * Insert the permissions related to settings table. |
|
18 | - */ |
|
19 | - \DB::table('permissions')->insert( |
|
20 | - [ |
|
21 | - /** |
|
22 | - * pushNotificationDevices model permissions. |
|
23 | - */ |
|
24 | - [ |
|
25 | - 'name' => 'find', |
|
26 | - 'model' => 'pushNotificationDevices', |
|
27 | - 'created_at' => \DB::raw('NOW()'), |
|
28 | - 'updated_at' => \DB::raw('NOW()') |
|
29 | - ], |
|
30 | - [ |
|
31 | - 'name' => 'search', |
|
32 | - 'model' => 'pushNotificationDevices', |
|
33 | - 'created_at' => \DB::raw('NOW()'), |
|
34 | - 'updated_at' => \DB::raw('NOW()') |
|
35 | - ], |
|
36 | - [ |
|
37 | - 'name' => 'list', |
|
38 | - 'model' => 'pushNotificationDevices', |
|
39 | - 'created_at' => \DB::raw('NOW()'), |
|
40 | - 'updated_at' => \DB::raw('NOW()') |
|
41 | - ], |
|
42 | - [ |
|
43 | - 'name' => 'findby', |
|
44 | - 'model' => 'pushNotificationDevices', |
|
45 | - 'created_at' => \DB::raw('NOW()'), |
|
46 | - 'updated_at' => \DB::raw('NOW()') |
|
47 | - ], |
|
48 | - [ |
|
49 | - 'name' => 'first', |
|
50 | - 'model' => 'pushNotificationDevices', |
|
51 | - 'created_at' => \DB::raw('NOW()'), |
|
52 | - 'updated_at' => \DB::raw('NOW()') |
|
53 | - ], |
|
54 | - [ |
|
55 | - 'name' => 'paginate', |
|
56 | - 'model' => 'pushNotificationDevices', |
|
57 | - 'created_at' => \DB::raw('NOW()'), |
|
58 | - 'updated_at' => \DB::raw('NOW()') |
|
59 | - ], |
|
60 | - [ |
|
61 | - 'name' => 'paginateby', |
|
62 | - 'model' => 'pushNotificationDevices', |
|
63 | - 'created_at' => \DB::raw('NOW()'), |
|
64 | - 'updated_at' => \DB::raw('NOW()') |
|
65 | - ], |
|
66 | - [ |
|
67 | - 'name' => 'save', |
|
68 | - 'model' => 'pushNotificationDevices', |
|
69 | - 'created_at' => \DB::raw('NOW()'), |
|
70 | - 'updated_at' => \DB::raw('NOW()') |
|
71 | - ], |
|
72 | - [ |
|
73 | - 'name' => 'delete', |
|
74 | - 'model' => 'pushNotificationDevices', |
|
75 | - 'created_at' => \DB::raw('NOW()'), |
|
76 | - 'updated_at' => \DB::raw('NOW()') |
|
77 | - ], |
|
78 | - [ |
|
79 | - 'name' => 'deleted', |
|
80 | - 'model' => 'pushNotificationDevices', |
|
81 | - 'created_at' => \DB::raw('NOW()'), |
|
82 | - 'updated_at' => \DB::raw('NOW()') |
|
83 | - ], |
|
84 | - [ |
|
85 | - 'name' => 'restore', |
|
86 | - 'model' => 'pushNotificationDevices', |
|
87 | - 'created_at' => \DB::raw('NOW()'), |
|
88 | - 'updated_at' => \DB::raw('NOW()') |
|
89 | - ] |
|
90 | - ] |
|
91 | - ); |
|
92 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + /** |
|
17 | + * Insert the permissions related to settings table. |
|
18 | + */ |
|
19 | + \DB::table('permissions')->insert( |
|
20 | + [ |
|
21 | + /** |
|
22 | + * pushNotificationDevices model permissions. |
|
23 | + */ |
|
24 | + [ |
|
25 | + 'name' => 'find', |
|
26 | + 'model' => 'pushNotificationDevices', |
|
27 | + 'created_at' => \DB::raw('NOW()'), |
|
28 | + 'updated_at' => \DB::raw('NOW()') |
|
29 | + ], |
|
30 | + [ |
|
31 | + 'name' => 'search', |
|
32 | + 'model' => 'pushNotificationDevices', |
|
33 | + 'created_at' => \DB::raw('NOW()'), |
|
34 | + 'updated_at' => \DB::raw('NOW()') |
|
35 | + ], |
|
36 | + [ |
|
37 | + 'name' => 'list', |
|
38 | + 'model' => 'pushNotificationDevices', |
|
39 | + 'created_at' => \DB::raw('NOW()'), |
|
40 | + 'updated_at' => \DB::raw('NOW()') |
|
41 | + ], |
|
42 | + [ |
|
43 | + 'name' => 'findby', |
|
44 | + 'model' => 'pushNotificationDevices', |
|
45 | + 'created_at' => \DB::raw('NOW()'), |
|
46 | + 'updated_at' => \DB::raw('NOW()') |
|
47 | + ], |
|
48 | + [ |
|
49 | + 'name' => 'first', |
|
50 | + 'model' => 'pushNotificationDevices', |
|
51 | + 'created_at' => \DB::raw('NOW()'), |
|
52 | + 'updated_at' => \DB::raw('NOW()') |
|
53 | + ], |
|
54 | + [ |
|
55 | + 'name' => 'paginate', |
|
56 | + 'model' => 'pushNotificationDevices', |
|
57 | + 'created_at' => \DB::raw('NOW()'), |
|
58 | + 'updated_at' => \DB::raw('NOW()') |
|
59 | + ], |
|
60 | + [ |
|
61 | + 'name' => 'paginateby', |
|
62 | + 'model' => 'pushNotificationDevices', |
|
63 | + 'created_at' => \DB::raw('NOW()'), |
|
64 | + 'updated_at' => \DB::raw('NOW()') |
|
65 | + ], |
|
66 | + [ |
|
67 | + 'name' => 'save', |
|
68 | + 'model' => 'pushNotificationDevices', |
|
69 | + 'created_at' => \DB::raw('NOW()'), |
|
70 | + 'updated_at' => \DB::raw('NOW()') |
|
71 | + ], |
|
72 | + [ |
|
73 | + 'name' => 'delete', |
|
74 | + 'model' => 'pushNotificationDevices', |
|
75 | + 'created_at' => \DB::raw('NOW()'), |
|
76 | + 'updated_at' => \DB::raw('NOW()') |
|
77 | + ], |
|
78 | + [ |
|
79 | + 'name' => 'deleted', |
|
80 | + 'model' => 'pushNotificationDevices', |
|
81 | + 'created_at' => \DB::raw('NOW()'), |
|
82 | + 'updated_at' => \DB::raw('NOW()') |
|
83 | + ], |
|
84 | + [ |
|
85 | + 'name' => 'restore', |
|
86 | + 'model' => 'pushNotificationDevices', |
|
87 | + 'created_at' => \DB::raw('NOW()'), |
|
88 | + 'updated_at' => \DB::raw('NOW()') |
|
89 | + ] |
|
90 | + ] |
|
91 | + ); |
|
92 | + } |
|
93 | 93 | } |
@@ -6,16 +6,16 @@ |
||
6 | 6 | |
7 | 7 | class NotificationsDatabaseSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - $this->call(ClearDataSeeder::class); |
|
17 | - $this->call(NotificationsTableSeeder::class); |
|
18 | - $this->call(PushNotificationsDevicesTableSeeder::class); |
|
19 | - $this->call(AssignRelationsSeeder::class); |
|
20 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + $this->call(ClearDataSeeder::class); |
|
17 | + $this->call(NotificationsTableSeeder::class); |
|
18 | + $this->call(PushNotificationsDevicesTableSeeder::class); |
|
19 | + $this->call(AssignRelationsSeeder::class); |
|
20 | + } |
|
21 | 21 | } |