@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $factory->define(App\Modules\V1\Acl\AclPermission::class, function (Faker\Generator $faker) { |
4 | - return [ |
|
4 | + return [ |
|
5 | 5 | 'name' => $faker->randomElement(['save', 'delete', 'find', 'paginate']), |
6 | 6 | 'model' => $faker->randomElement(['users', 'groups', 'settings', 'notifications']), |
7 | 7 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
8 | 8 | 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
9 | - ]; |
|
9 | + ]; |
|
10 | 10 | }); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$factory->define(App\Modules\V1\Acl\AclPermission::class, function (Faker\Generator $faker) { |
|
3 | +$factory->define(App\Modules\V1\Acl\AclPermission::class, function(Faker\Generator $faker) { |
|
4 | 4 | return [ |
5 | 5 | 'name' => $faker->randomElement(['save', 'delete', 'find', 'paginate']), |
6 | 6 | 'model' => $faker->randomElement(['users', 'groups', 'settings', 'notifications']), |
@@ -5,53 +5,53 @@ |
||
5 | 5 | */ |
6 | 6 | class AclPermissionObserver { |
7 | 7 | |
8 | - public function saving($model) |
|
9 | - { |
|
10 | - // |
|
11 | - } |
|
12 | - |
|
13 | - public function saved($model) |
|
14 | - { |
|
15 | - // |
|
16 | - } |
|
17 | - |
|
18 | - public function creating($model) |
|
19 | - { |
|
20 | - // |
|
21 | - } |
|
22 | - |
|
23 | - public function created($model) |
|
24 | - { |
|
25 | - // |
|
26 | - } |
|
27 | - |
|
28 | - public function updating($model) |
|
29 | - { |
|
30 | - // |
|
31 | - } |
|
32 | - |
|
33 | - public function updated($model) |
|
34 | - { |
|
35 | - // |
|
36 | - } |
|
37 | - |
|
38 | - public function deleting($model) |
|
39 | - { |
|
40 | - // |
|
41 | - } |
|
42 | - |
|
43 | - public function deleted($model) |
|
44 | - { |
|
45 | - // |
|
46 | - } |
|
47 | - |
|
48 | - public function restoring($model) |
|
49 | - { |
|
50 | - // |
|
51 | - } |
|
52 | - |
|
53 | - public function restored($model) |
|
54 | - { |
|
55 | - // |
|
56 | - } |
|
8 | + public function saving($model) |
|
9 | + { |
|
10 | + // |
|
11 | + } |
|
12 | + |
|
13 | + public function saved($model) |
|
14 | + { |
|
15 | + // |
|
16 | + } |
|
17 | + |
|
18 | + public function creating($model) |
|
19 | + { |
|
20 | + // |
|
21 | + } |
|
22 | + |
|
23 | + public function created($model) |
|
24 | + { |
|
25 | + // |
|
26 | + } |
|
27 | + |
|
28 | + public function updating($model) |
|
29 | + { |
|
30 | + // |
|
31 | + } |
|
32 | + |
|
33 | + public function updated($model) |
|
34 | + { |
|
35 | + // |
|
36 | + } |
|
37 | + |
|
38 | + public function deleting($model) |
|
39 | + { |
|
40 | + // |
|
41 | + } |
|
42 | + |
|
43 | + public function deleted($model) |
|
44 | + { |
|
45 | + // |
|
46 | + } |
|
47 | + |
|
48 | + public function restoring($model) |
|
49 | + { |
|
50 | + // |
|
51 | + } |
|
52 | + |
|
53 | + public function restored($model) |
|
54 | + { |
|
55 | + // |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -5,71 +5,71 @@ |
||
5 | 5 | */ |
6 | 6 | class AclGroupObserver { |
7 | 7 | |
8 | - public function saving($model) |
|
9 | - { |
|
10 | - // |
|
11 | - } |
|
8 | + public function saving($model) |
|
9 | + { |
|
10 | + // |
|
11 | + } |
|
12 | 12 | |
13 | - public function saved($model) |
|
14 | - { |
|
15 | - // |
|
16 | - } |
|
13 | + public function saved($model) |
|
14 | + { |
|
15 | + // |
|
16 | + } |
|
17 | 17 | |
18 | - public function creating($model) |
|
19 | - { |
|
20 | - // |
|
21 | - } |
|
18 | + public function creating($model) |
|
19 | + { |
|
20 | + // |
|
21 | + } |
|
22 | 22 | |
23 | - public function created($model) |
|
24 | - { |
|
25 | - // |
|
26 | - } |
|
23 | + public function created($model) |
|
24 | + { |
|
25 | + // |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Prevent updating of the admin group. |
|
30 | - * |
|
31 | - * @param object $model the model beign updated. |
|
32 | - * @return void |
|
33 | - */ |
|
34 | - public function updating($model) |
|
35 | - { |
|
36 | - if ($model->getOriginal('name') == 'Admin') |
|
37 | - { |
|
38 | - \ErrorHandler::noPermissions(); |
|
39 | - } |
|
40 | - } |
|
28 | + /** |
|
29 | + * Prevent updating of the admin group. |
|
30 | + * |
|
31 | + * @param object $model the model beign updated. |
|
32 | + * @return void |
|
33 | + */ |
|
34 | + public function updating($model) |
|
35 | + { |
|
36 | + if ($model->getOriginal('name') == 'Admin') |
|
37 | + { |
|
38 | + \ErrorHandler::noPermissions(); |
|
39 | + } |
|
40 | + } |
|
41 | 41 | |
42 | - public function updated($model) |
|
43 | - { |
|
44 | - // |
|
45 | - } |
|
42 | + public function updated($model) |
|
43 | + { |
|
44 | + // |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * Prevent deleting the admin group. |
|
49 | - * |
|
50 | - * @param object $model the delted model. |
|
51 | - * @return void |
|
52 | - */ |
|
53 | - public function deleting($model) |
|
54 | - { |
|
55 | - if ($model->getOriginal('name') == 'Admin') |
|
56 | - { |
|
57 | - \ErrorHandler::noPermissions(); |
|
58 | - } |
|
59 | - } |
|
47 | + /** |
|
48 | + * Prevent deleting the admin group. |
|
49 | + * |
|
50 | + * @param object $model the delted model. |
|
51 | + * @return void |
|
52 | + */ |
|
53 | + public function deleting($model) |
|
54 | + { |
|
55 | + if ($model->getOriginal('name') == 'Admin') |
|
56 | + { |
|
57 | + \ErrorHandler::noPermissions(); |
|
58 | + } |
|
59 | + } |
|
60 | 60 | |
61 | - public function deleted($model) |
|
62 | - { |
|
63 | - // |
|
64 | - } |
|
61 | + public function deleted($model) |
|
62 | + { |
|
63 | + // |
|
64 | + } |
|
65 | 65 | |
66 | - public function restoring($model) |
|
67 | - { |
|
68 | - // |
|
69 | - } |
|
66 | + public function restoring($model) |
|
67 | + { |
|
68 | + // |
|
69 | + } |
|
70 | 70 | |
71 | - public function restored($model) |
|
72 | - { |
|
73 | - // |
|
74 | - } |
|
71 | + public function restored($model) |
|
72 | + { |
|
73 | + // |
|
74 | + } |
|
75 | 75 | } |
76 | 76 | \ No newline at end of file |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $factory->define(App\Modules\V1\Reporting\Report::class, function (Faker\Generator $faker) { |
4 | - return [ |
|
4 | + return [ |
|
5 | 5 | 'report_name' => $faker->randomElement(['Users Count', 'Low Stock Products', 'Active Users']), |
6 | 6 | 'view_name' => $faker->word(), |
7 | 7 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
8 | 8 | 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
9 | - ]; |
|
9 | + ]; |
|
10 | 10 | }); |
11 | 11 | \ No newline at end of file |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$factory->define(App\Modules\V1\Reporting\Report::class, function (Faker\Generator $faker) { |
|
3 | +$factory->define(App\Modules\V1\Reporting\Report::class, function(Faker\Generator $faker) { |
|
4 | 4 | return [ |
5 | 5 | 'report_name' => $faker->randomElement(['Users Count', 'Low Stock Products', 'Active Users']), |
6 | 6 | 'view_name' => $faker->word(), |
@@ -5,53 +5,53 @@ |
||
5 | 5 | */ |
6 | 6 | class ReprotObserver { |
7 | 7 | |
8 | - public function saving($model) |
|
9 | - { |
|
10 | - // |
|
11 | - } |
|
12 | - |
|
13 | - public function saved($model) |
|
14 | - { |
|
15 | - // |
|
16 | - } |
|
17 | - |
|
18 | - public function creating($model) |
|
19 | - { |
|
20 | - // |
|
21 | - } |
|
22 | - |
|
23 | - public function created($model) |
|
24 | - { |
|
25 | - // |
|
26 | - } |
|
27 | - |
|
28 | - public function updating($model) |
|
29 | - { |
|
30 | - // |
|
31 | - } |
|
32 | - |
|
33 | - public function updated($model) |
|
34 | - { |
|
35 | - // |
|
36 | - } |
|
37 | - |
|
38 | - public function deleting($model) |
|
39 | - { |
|
40 | - // |
|
41 | - } |
|
42 | - |
|
43 | - public function deleted($model) |
|
44 | - { |
|
45 | - // |
|
46 | - } |
|
47 | - |
|
48 | - public function restoring($model) |
|
49 | - { |
|
50 | - // |
|
51 | - } |
|
52 | - |
|
53 | - public function restored($model) |
|
54 | - { |
|
55 | - // |
|
56 | - } |
|
8 | + public function saving($model) |
|
9 | + { |
|
10 | + // |
|
11 | + } |
|
12 | + |
|
13 | + public function saved($model) |
|
14 | + { |
|
15 | + // |
|
16 | + } |
|
17 | + |
|
18 | + public function creating($model) |
|
19 | + { |
|
20 | + // |
|
21 | + } |
|
22 | + |
|
23 | + public function created($model) |
|
24 | + { |
|
25 | + // |
|
26 | + } |
|
27 | + |
|
28 | + public function updating($model) |
|
29 | + { |
|
30 | + // |
|
31 | + } |
|
32 | + |
|
33 | + public function updated($model) |
|
34 | + { |
|
35 | + // |
|
36 | + } |
|
37 | + |
|
38 | + public function deleting($model) |
|
39 | + { |
|
40 | + // |
|
41 | + } |
|
42 | + |
|
43 | + public function deleted($model) |
|
44 | + { |
|
45 | + // |
|
46 | + } |
|
47 | + |
|
48 | + public function restoring($model) |
|
49 | + { |
|
50 | + // |
|
51 | + } |
|
52 | + |
|
53 | + public function restored($model) |
|
54 | + { |
|
55 | + // |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -5,53 +5,53 @@ |
||
5 | 5 | */ |
6 | 6 | class PushNotificationDeviceObserver { |
7 | 7 | |
8 | - public function saving($model) |
|
9 | - { |
|
10 | - // |
|
11 | - } |
|
12 | - |
|
13 | - public function saved($model) |
|
14 | - { |
|
15 | - // |
|
16 | - } |
|
17 | - |
|
18 | - public function creating($model) |
|
19 | - { |
|
20 | - // |
|
21 | - } |
|
22 | - |
|
23 | - public function created($model) |
|
24 | - { |
|
25 | - // |
|
26 | - } |
|
27 | - |
|
28 | - public function updating($model) |
|
29 | - { |
|
30 | - // |
|
31 | - } |
|
32 | - |
|
33 | - public function updated($model) |
|
34 | - { |
|
35 | - // |
|
36 | - } |
|
37 | - |
|
38 | - public function deleting($model) |
|
39 | - { |
|
40 | - // |
|
41 | - } |
|
42 | - |
|
43 | - public function deleted($model) |
|
44 | - { |
|
45 | - // |
|
46 | - } |
|
47 | - |
|
48 | - public function restoring($model) |
|
49 | - { |
|
50 | - // |
|
51 | - } |
|
52 | - |
|
53 | - public function restored($model) |
|
54 | - { |
|
55 | - // |
|
56 | - } |
|
8 | + public function saving($model) |
|
9 | + { |
|
10 | + // |
|
11 | + } |
|
12 | + |
|
13 | + public function saved($model) |
|
14 | + { |
|
15 | + // |
|
16 | + } |
|
17 | + |
|
18 | + public function creating($model) |
|
19 | + { |
|
20 | + // |
|
21 | + } |
|
22 | + |
|
23 | + public function created($model) |
|
24 | + { |
|
25 | + // |
|
26 | + } |
|
27 | + |
|
28 | + public function updating($model) |
|
29 | + { |
|
30 | + // |
|
31 | + } |
|
32 | + |
|
33 | + public function updated($model) |
|
34 | + { |
|
35 | + // |
|
36 | + } |
|
37 | + |
|
38 | + public function deleting($model) |
|
39 | + { |
|
40 | + // |
|
41 | + } |
|
42 | + |
|
43 | + public function deleted($model) |
|
44 | + { |
|
45 | + // |
|
46 | + } |
|
47 | + |
|
48 | + public function restoring($model) |
|
49 | + { |
|
50 | + // |
|
51 | + } |
|
52 | + |
|
53 | + public function restored($model) |
|
54 | + { |
|
55 | + // |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -64,7 +64,7 @@ |
||
64 | 64 | if ($this->cacheConfig && $this->cacheConfig == 'cache') |
65 | 65 | { |
66 | 66 | $page = \Request::get('page') !== null ? \Request::get('page') : '1'; |
67 | - $cacheKey = $name . $page . \Session::get('locale') . serialize($arguments); |
|
67 | + $cacheKey = $name.$page.\Session::get('locale').serialize($arguments); |
|
68 | 68 | return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) { |
69 | 69 | return call_user_func_array([$this->repo, $name], $arguments); |
70 | 70 | }); |
@@ -68,8 +68,7 @@ discard block |
||
68 | 68 | return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) { |
69 | 69 | return call_user_func_array([$this->repo, $name], $arguments); |
70 | 70 | }); |
71 | - } |
|
72 | - else if ($this->cacheConfig) |
|
71 | + } else if ($this->cacheConfig) |
|
73 | 72 | { |
74 | 73 | $this->cache->tags($this->cacheConfig)->flush(); |
75 | 74 | return call_user_func_array([$this->repo, $name], $arguments); |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | if ($cacheConfig && in_array($name, $cacheConfig['cache'])) |
94 | 93 | { |
95 | 94 | $this->cacheConfig = 'cache'; |
96 | - } |
|
97 | - else if ($cacheConfig && isset($cacheConfig['clear'][$name])) |
|
95 | + } else if ($cacheConfig && isset($cacheConfig['clear'][$name])) |
|
98 | 96 | { |
99 | 97 | $this->cacheConfig = $cacheConfig['clear'][$name]; |
100 | 98 | } |
@@ -2,117 +2,117 @@ |
||
2 | 2 | |
3 | 3 | class CachingDecorator |
4 | 4 | { |
5 | - /** |
|
6 | - * The repo implementation. |
|
7 | - * |
|
8 | - * @var string |
|
9 | - */ |
|
10 | - public $repo; |
|
5 | + /** |
|
6 | + * The repo implementation. |
|
7 | + * |
|
8 | + * @var string |
|
9 | + */ |
|
10 | + public $repo; |
|
11 | 11 | |
12 | - /** |
|
13 | - * The cache implementation. |
|
14 | - * |
|
15 | - * @var object |
|
16 | - */ |
|
17 | - protected $cache; |
|
12 | + /** |
|
13 | + * The cache implementation. |
|
14 | + * |
|
15 | + * @var object |
|
16 | + */ |
|
17 | + protected $cache; |
|
18 | 18 | |
19 | - /** |
|
20 | - * The modelKey implementation. |
|
21 | - * |
|
22 | - * @var string |
|
23 | - */ |
|
24 | - public $modelKey; |
|
19 | + /** |
|
20 | + * The modelKey implementation. |
|
21 | + * |
|
22 | + * @var string |
|
23 | + */ |
|
24 | + public $modelKey; |
|
25 | 25 | |
26 | - /** |
|
27 | - * The model implementation. |
|
28 | - * |
|
29 | - * @var string |
|
30 | - */ |
|
31 | - public $model; |
|
26 | + /** |
|
27 | + * The model implementation. |
|
28 | + * |
|
29 | + * @var string |
|
30 | + */ |
|
31 | + public $model; |
|
32 | 32 | |
33 | - /** |
|
34 | - * The modelClass implementation. |
|
35 | - * |
|
36 | - * @var string |
|
37 | - */ |
|
38 | - public $modelClass; |
|
33 | + /** |
|
34 | + * The modelClass implementation. |
|
35 | + * |
|
36 | + * @var string |
|
37 | + */ |
|
38 | + public $modelClass; |
|
39 | 39 | |
40 | - /** |
|
41 | - * The cacheConfig implementation. |
|
42 | - * |
|
43 | - * @var array |
|
44 | - */ |
|
45 | - public $cacheConfig; |
|
40 | + /** |
|
41 | + * The cacheConfig implementation. |
|
42 | + * |
|
43 | + * @var array |
|
44 | + */ |
|
45 | + public $cacheConfig; |
|
46 | 46 | |
47 | - /** |
|
48 | - * The cacheTag implementation. |
|
49 | - * |
|
50 | - * @var string |
|
51 | - */ |
|
52 | - public $cacheTag; |
|
47 | + /** |
|
48 | + * The cacheTag implementation. |
|
49 | + * |
|
50 | + * @var string |
|
51 | + */ |
|
52 | + public $cacheTag; |
|
53 | 53 | |
54 | - /** |
|
55 | - * Create new CachingDecorator instance. |
|
56 | - */ |
|
57 | - public function __construct($repo, $cache) |
|
58 | - { |
|
59 | - $this->repo = $repo; |
|
60 | - $this->cache = $cache; |
|
61 | - $this->model = $this->repo->model; |
|
62 | - $this->modelClass = get_class($this->model); |
|
63 | - $repoClass = explode('\\', get_class($this->repo)); |
|
64 | - $repoName = end($repoClass); |
|
65 | - $this->cacheTag = str_plural(lcfirst(substr($repoName, 0, strpos($repoName, 'Repository')))); |
|
66 | - } |
|
54 | + /** |
|
55 | + * Create new CachingDecorator instance. |
|
56 | + */ |
|
57 | + public function __construct($repo, $cache) |
|
58 | + { |
|
59 | + $this->repo = $repo; |
|
60 | + $this->cache = $cache; |
|
61 | + $this->model = $this->repo->model; |
|
62 | + $this->modelClass = get_class($this->model); |
|
63 | + $repoClass = explode('\\', get_class($this->repo)); |
|
64 | + $repoName = end($repoClass); |
|
65 | + $this->cacheTag = str_plural(lcfirst(substr($repoName, 0, strpos($repoName, 'Repository')))); |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * Handle the cache mechanism for the called method |
|
70 | - * based the configurations. |
|
71 | - * |
|
72 | - * @param string $name the called method name |
|
73 | - * @param array $arguments the method arguments |
|
74 | - * @return object |
|
75 | - */ |
|
76 | - public function __call($name, $arguments) |
|
77 | - { |
|
78 | - $this->setCacheConfig($name); |
|
68 | + /** |
|
69 | + * Handle the cache mechanism for the called method |
|
70 | + * based the configurations. |
|
71 | + * |
|
72 | + * @param string $name the called method name |
|
73 | + * @param array $arguments the method arguments |
|
74 | + * @return object |
|
75 | + */ |
|
76 | + public function __call($name, $arguments) |
|
77 | + { |
|
78 | + $this->setCacheConfig($name); |
|
79 | 79 | |
80 | - if ($this->cacheConfig && $this->cacheConfig == 'cache') |
|
81 | - { |
|
82 | - $page = \Request::get('page') !== null ? \Request::get('page') : '1'; |
|
83 | - $cacheKey = $name . $page . \Session::get('locale') . serialize($arguments); |
|
84 | - return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) { |
|
85 | - return call_user_func_array([$this->repo, $name], $arguments); |
|
86 | - }); |
|
87 | - } |
|
88 | - else if ($this->cacheConfig) |
|
89 | - { |
|
90 | - $this->cache->tags($this->cacheConfig)->flush(); |
|
91 | - return call_user_func_array([$this->repo, $name], $arguments); |
|
92 | - } |
|
80 | + if ($this->cacheConfig && $this->cacheConfig == 'cache') |
|
81 | + { |
|
82 | + $page = \Request::get('page') !== null ? \Request::get('page') : '1'; |
|
83 | + $cacheKey = $name . $page . \Session::get('locale') . serialize($arguments); |
|
84 | + return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) { |
|
85 | + return call_user_func_array([$this->repo, $name], $arguments); |
|
86 | + }); |
|
87 | + } |
|
88 | + else if ($this->cacheConfig) |
|
89 | + { |
|
90 | + $this->cache->tags($this->cacheConfig)->flush(); |
|
91 | + return call_user_func_array([$this->repo, $name], $arguments); |
|
92 | + } |
|
93 | 93 | |
94 | - return call_user_func_array([$this->repo, $name], $arguments); |
|
95 | - } |
|
94 | + return call_user_func_array([$this->repo, $name], $arguments); |
|
95 | + } |
|
96 | 96 | |
97 | - /** |
|
98 | - * Set cache config based on the called method. |
|
99 | - * |
|
100 | - * @param string $name |
|
101 | - * @return void |
|
102 | - */ |
|
103 | - private function setCacheConfig($name) |
|
104 | - { |
|
105 | - $config = \CoreConfig::getConfig(); |
|
106 | - $cacheConfig = array_key_exists($this->cacheTag, $config['cacheConfig']) ? $config['cacheConfig'][$this->cacheTag] : false; |
|
107 | - $this->cacheConfig = false; |
|
97 | + /** |
|
98 | + * Set cache config based on the called method. |
|
99 | + * |
|
100 | + * @param string $name |
|
101 | + * @return void |
|
102 | + */ |
|
103 | + private function setCacheConfig($name) |
|
104 | + { |
|
105 | + $config = \CoreConfig::getConfig(); |
|
106 | + $cacheConfig = array_key_exists($this->cacheTag, $config['cacheConfig']) ? $config['cacheConfig'][$this->cacheTag] : false; |
|
107 | + $this->cacheConfig = false; |
|
108 | 108 | |
109 | - if ($cacheConfig && in_array($name, $cacheConfig['cache'])) |
|
110 | - { |
|
111 | - $this->cacheConfig = 'cache'; |
|
112 | - } |
|
113 | - else if ($cacheConfig && isset($cacheConfig['clear'][$name])) |
|
114 | - { |
|
115 | - $this->cacheConfig = $cacheConfig['clear'][$name]; |
|
116 | - } |
|
117 | - } |
|
109 | + if ($cacheConfig && in_array($name, $cacheConfig['cache'])) |
|
110 | + { |
|
111 | + $this->cacheConfig = 'cache'; |
|
112 | + } |
|
113 | + else if ($cacheConfig && isset($cacheConfig['clear'][$name])) |
|
114 | + { |
|
115 | + $this->cacheConfig = $cacheConfig['clear'][$name]; |
|
116 | + } |
|
117 | + } |
|
118 | 118 | } |
119 | 119 | \ No newline at end of file |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $factory->define(App\Modules\V1\Core\Settings::class, function (Faker\Generator $faker) { |
4 | - return [ |
|
4 | + return [ |
|
5 | 5 | 'name' => $faker->randomElement(['Company Name', 'Title', 'Header Image']), |
6 | 6 | 'value' => $faker->word(), |
7 | 7 | 'key' => $faker->word(), |
8 | 8 | 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
9 | 9 | 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
10 | - ]; |
|
10 | + ]; |
|
11 | 11 | }); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$factory->define(App\Modules\V1\Core\Settings::class, function (Faker\Generator $faker) { |
|
3 | +$factory->define(App\Modules\V1\Core\Settings::class, function(Faker\Generator $faker) { |
|
4 | 4 | return [ |
5 | 5 | 'name' => $faker->randomElement(['Company Name', 'Title', 'Header Image']), |
6 | 6 | 'value' => $faker->word(), |
@@ -5,68 +5,68 @@ |
||
5 | 5 | */ |
6 | 6 | class SettingsObserver { |
7 | 7 | |
8 | - public function saving($model) |
|
9 | - { |
|
10 | - // |
|
11 | - } |
|
8 | + public function saving($model) |
|
9 | + { |
|
10 | + // |
|
11 | + } |
|
12 | 12 | |
13 | - public function saved($model) |
|
14 | - { |
|
15 | - // |
|
16 | - } |
|
13 | + public function saved($model) |
|
14 | + { |
|
15 | + // |
|
16 | + } |
|
17 | 17 | |
18 | - /** |
|
19 | - * Prevent the creating of the settings. |
|
20 | - * |
|
21 | - * @param object $model the model beign created. |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - public function creating($model) |
|
25 | - { |
|
26 | - \ErrorHandler::cannotCreateSetting(); |
|
27 | - } |
|
18 | + /** |
|
19 | + * Prevent the creating of the settings. |
|
20 | + * |
|
21 | + * @param object $model the model beign created. |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + public function creating($model) |
|
25 | + { |
|
26 | + \ErrorHandler::cannotCreateSetting(); |
|
27 | + } |
|
28 | 28 | |
29 | - public function created($model) |
|
30 | - { |
|
31 | - // |
|
32 | - } |
|
29 | + public function created($model) |
|
30 | + { |
|
31 | + // |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Prevent updating of the setting key. |
|
36 | - * |
|
37 | - * @param object $model the model beign updated. |
|
38 | - * @return void |
|
39 | - */ |
|
40 | - public function updating($model) |
|
41 | - { |
|
42 | - if ($model->getOriginal('key') !== $model->key) |
|
43 | - { |
|
44 | - \ErrorHandler::cannotUpdateSettingKey(); |
|
45 | - } |
|
46 | - } |
|
34 | + /** |
|
35 | + * Prevent updating of the setting key. |
|
36 | + * |
|
37 | + * @param object $model the model beign updated. |
|
38 | + * @return void |
|
39 | + */ |
|
40 | + public function updating($model) |
|
41 | + { |
|
42 | + if ($model->getOriginal('key') !== $model->key) |
|
43 | + { |
|
44 | + \ErrorHandler::cannotUpdateSettingKey(); |
|
45 | + } |
|
46 | + } |
|
47 | 47 | |
48 | - public function updated($model) |
|
49 | - { |
|
50 | - // |
|
51 | - } |
|
48 | + public function updated($model) |
|
49 | + { |
|
50 | + // |
|
51 | + } |
|
52 | 52 | |
53 | - public function deleting($model) |
|
54 | - { |
|
55 | - // |
|
56 | - } |
|
53 | + public function deleting($model) |
|
54 | + { |
|
55 | + // |
|
56 | + } |
|
57 | 57 | |
58 | - public function deleted($model) |
|
59 | - { |
|
60 | - // |
|
61 | - } |
|
58 | + public function deleted($model) |
|
59 | + { |
|
60 | + // |
|
61 | + } |
|
62 | 62 | |
63 | - public function restoring($model) |
|
64 | - { |
|
65 | - // |
|
66 | - } |
|
63 | + public function restoring($model) |
|
64 | + { |
|
65 | + // |
|
66 | + } |
|
67 | 67 | |
68 | - public function restored($model) |
|
69 | - { |
|
70 | - // |
|
71 | - } |
|
68 | + public function restored($model) |
|
69 | + { |
|
70 | + // |
|
71 | + } |
|
72 | 72 | } |
73 | 73 | \ No newline at end of file |