@@ -4,13 +4,13 @@ |
||
4 | 4 | { |
5 | 5 | /** |
6 | 6 | * Construct the repository class name based on |
7 | - * the method name called, search in the |
|
8 | - * given namespaces for the class and |
|
9 | - * return an instance. |
|
10 | - * |
|
11 | - * @param string $name the called method name |
|
12 | - * @param array $arguments the method arguments |
|
13 | - * @return object |
|
14 | - */ |
|
7 | + * the method name called, search in the |
|
8 | + * given namespaces for the class and |
|
9 | + * return an instance. |
|
10 | + * |
|
11 | + * @param string $name the called method name |
|
12 | + * @param array $arguments the method arguments |
|
13 | + * @return object |
|
14 | + */ |
|
15 | 15 | public function __call($name, $arguments); |
16 | 16 | } |
17 | 17 | \ No newline at end of file |
@@ -8,9 +8,9 @@ |
||
8 | 8 | class LogsController extends BaseApiController |
9 | 9 | { |
10 | 10 | /** |
11 | - * The name of the model that is used by the base api controller |
|
12 | - * to preform actions like (add, edit ... etc). |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $model = 'logs'; |
|
11 | + * The name of the model that is used by the base api controller |
|
12 | + * to preform actions like (add, edit ... etc). |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $model = 'logs'; |
|
16 | 16 | } |
@@ -22,15 +22,15 @@ |
||
22 | 22 | "); |
23 | 23 | |
24 | 24 | DB::table('reports')->insert( |
25 | - [ |
|
26 | - [ |
|
25 | + [ |
|
26 | + [ |
|
27 | 27 | 'report_name' => 'admin_count', |
28 | 28 | 'view_name' => 'admin_count', |
29 | 29 | 'created_at' => \DB::raw('NOW()'), |
30 | 30 | 'updated_at' => \DB::raw('NOW()') |
31 | - ] |
|
32 | - ] |
|
33 | - ); |
|
31 | + ] |
|
32 | + ] |
|
33 | + ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $table->string('view_name',100); |
19 | 19 | $table->softDeletes(); |
20 | 20 | $table->timestamps(); |
21 | - }); |
|
21 | + }); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -13,19 +13,19 @@ |
||
13 | 13 | public function up() |
14 | 14 | { |
15 | 15 | Schema::create('groups', function (Blueprint $table) { |
16 | - $table->increments('id'); |
|
17 | - $table->string('name',100)->unique(); |
|
18 | - $table->softDeletes(); |
|
19 | - $table->timestamps(); |
|
20 | - }); |
|
16 | + $table->increments('id'); |
|
17 | + $table->string('name',100)->unique(); |
|
18 | + $table->softDeletes(); |
|
19 | + $table->timestamps(); |
|
20 | + }); |
|
21 | 21 | |
22 | - Schema::create('users_groups', function (Blueprint $table) { |
|
23 | - $table->increments('id'); |
|
24 | - $table->integer('user_id'); |
|
25 | - $table->integer('group_id'); |
|
26 | - $table->softDeletes(); |
|
27 | - $table->timestamps(); |
|
28 | - }); |
|
22 | + Schema::create('users_groups', function (Blueprint $table) { |
|
23 | + $table->increments('id'); |
|
24 | + $table->integer('user_id'); |
|
25 | + $table->integer('group_id'); |
|
26 | + $table->softDeletes(); |
|
27 | + $table->timestamps(); |
|
28 | + }); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -12,21 +12,21 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('permissions', function (Blueprint $table) { |
|
16 | - $table->increments('id'); |
|
17 | - $table->string('name',100); |
|
18 | - $table->string('model',100); |
|
19 | - $table->softDeletes(); |
|
20 | - $table->timestamps(); |
|
21 | - $table->unique(array('name', 'model')); |
|
22 | - }); |
|
23 | - Schema::create('groups_permissions', function (Blueprint $table) { |
|
24 | - $table->increments('id'); |
|
25 | - $table->integer('group_id'); |
|
26 | - $table->integer('permission_id'); |
|
27 | - $table->softDeletes(); |
|
28 | - $table->timestamps(); |
|
29 | - }); |
|
15 | + Schema::create('permissions', function (Blueprint $table) { |
|
16 | + $table->increments('id'); |
|
17 | + $table->string('name',100); |
|
18 | + $table->string('model',100); |
|
19 | + $table->softDeletes(); |
|
20 | + $table->timestamps(); |
|
21 | + $table->unique(array('name', 'model')); |
|
22 | + }); |
|
23 | + Schema::create('groups_permissions', function (Blueprint $table) { |
|
24 | + $table->increments('id'); |
|
25 | + $table->integer('group_id'); |
|
26 | + $table->integer('permission_id'); |
|
27 | + $table->softDeletes(); |
|
28 | + $table->timestamps(); |
|
29 | + }); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -7,10 +7,10 @@ |
||
7 | 7 | |
8 | 8 | class PermissionsController extends BaseApiController |
9 | 9 | { |
10 | - /** |
|
11 | - * The name of the model that is used by the base api controller |
|
12 | - * to preform actions like (add, edit ... etc). |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $model = 'permissions'; |
|
10 | + /** |
|
11 | + * The name of the model that is used by the base api controller |
|
12 | + * to preform actions like (add, edit ... etc). |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $model = 'permissions'; |
|
16 | 16 | } |
@@ -2,17 +2,17 @@ |
||
2 | 2 | |
3 | 3 | class Logging |
4 | 4 | { |
5 | - public function saveLog($action, $item_name, $item_type, $item_id) |
|
6 | - { |
|
7 | - if (\Core::logs() && $item_name !== 'Log') |
|
8 | - { |
|
9 | - \Core::logs()->save([ |
|
10 | - 'action' => $action, |
|
11 | - 'item_name' => $item_name, |
|
12 | - 'item_type' => $item_type, |
|
13 | - 'item_id' => $item_id, |
|
14 | - 'user_id' => \JWTAuth::parseToken()->authenticate()->id, |
|
15 | - ], false, false); |
|
16 | - } |
|
17 | - } |
|
5 | + public function saveLog($action, $item_name, $item_type, $item_id) |
|
6 | + { |
|
7 | + if (\Core::logs() && $item_name !== 'Log') |
|
8 | + { |
|
9 | + \Core::logs()->save([ |
|
10 | + 'action' => $action, |
|
11 | + 'item_name' => $item_name, |
|
12 | + 'item_type' => $item_type, |
|
13 | + 'item_id' => $item_id, |
|
14 | + 'user_id' => \JWTAuth::parseToken()->authenticate()->id, |
|
15 | + ], false, false); |
|
16 | + } |
|
17 | + } |
|
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -7,22 +7,22 @@ |
||
7 | 7 | |
8 | 8 | class PushNotificationsDevicesController extends BaseApiController |
9 | 9 | { |
10 | - /** |
|
11 | - * The name of the model that is used by the base api controller |
|
12 | - * to preform actions like (add, edit ... etc). |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $model = 'pushNotificationDevices'; |
|
10 | + /** |
|
11 | + * The name of the model that is used by the base api controller |
|
12 | + * to preform actions like (add, edit ... etc). |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $model = 'pushNotificationDevices'; |
|
16 | 16 | |
17 | - /** |
|
18 | - * The validations rules used by the base api controller |
|
19 | - * to check before add. |
|
20 | - * @var array |
|
21 | - */ |
|
22 | - protected $validationRules = [ |
|
23 | - 'device_token' => 'required|string|max:255', |
|
24 | - 'device_type' => 'required|in:android,ios', |
|
25 | - 'user_id' => 'required|exists:users,id', |
|
26 | - 'active' => 'boolean' |
|
27 | - ]; |
|
17 | + /** |
|
18 | + * The validations rules used by the base api controller |
|
19 | + * to check before add. |
|
20 | + * @var array |
|
21 | + */ |
|
22 | + protected $validationRules = [ |
|
23 | + 'device_token' => 'required|string|max:255', |
|
24 | + 'device_type' => 'required|in:android,ios', |
|
25 | + 'user_id' => 'required|exists:users,id', |
|
26 | + 'active' => 'boolean' |
|
27 | + ]; |
|
28 | 28 | } |