@@ -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 | }); |
@@ -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(); |
@@ -13,14 +13,14 @@ |
||
13 | 13 | * to preform actions like (add, edit ... etc). |
14 | 14 | * @var string |
15 | 15 | */ |
16 | - protected $model = 'settings'; |
|
16 | + protected $model = 'settings'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * The validations rules used by the base api controller |
20 | 20 | * to check before add. |
21 | 21 | * @var array |
22 | 22 | */ |
23 | - protected $validationRules = [ |
|
23 | + protected $validationRules = [ |
|
24 | 24 | 'name' => 'required|string|max:100', |
25 | 25 | 'value' => 'required|string' |
26 | 26 | ]; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public function index() |
10 | 10 | { |
11 | - $path = str_replace($_SERVER['DOCUMENT_ROOT'], '',str_replace('\\', '/', __FILE__)); |
|
11 | + $path = str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', __FILE__)); |
|
12 | 12 | $baseUrl = str_replace('Http/Controllers/ApiDocumentController.php', '', $path); |
13 | 13 | $jsonDoc = json_decode(file_get_contents(app_path('Modules/V1/Core/Resources/api.json')), true); |
14 | 14 | $modules = $jsonDoc['modules']; |
@@ -21,27 +21,27 @@ discard block |
||
21 | 21 | ], |
22 | 22 | [ |
23 | 23 | 'title' => 'email equal [email protected] and user is blocked:', |
24 | - 'content' => ['and' => ['email' => '[email protected]','blocked' => 1]] |
|
24 | + 'content' => ['and' => ['email' => '[email protected]', 'blocked' => 1]] |
|
25 | 25 | ], |
26 | 26 | [ |
27 | 27 | 'title' => 'email equal [email protected] or user is blocked:', |
28 | - 'content' => ['or' => ['email' => '[email protected]','blocked' => 1]] |
|
28 | + 'content' => ['or' => ['email' => '[email protected]', 'blocked' => 1]] |
|
29 | 29 | ], |
30 | 30 | [ |
31 | 31 | 'title' => 'email contain John:', |
32 | - 'content' => ['email' => ['op' => 'like','val' => '%John%']] |
|
32 | + 'content' => ['email' => ['op' => 'like', 'val' => '%John%']] |
|
33 | 33 | ], |
34 | 34 | [ |
35 | 35 | 'title' => 'user created after 2016-10-25:', |
36 | - 'content' => ['created_at' => ['op' => '>','val' => '2016-10-25']] |
|
36 | + 'content' => ['created_at' => ['op' => '>', 'val' => '2016-10-25']] |
|
37 | 37 | ], |
38 | 38 | [ |
39 | 39 | 'title' => 'user created between 2016-10-20 and 2016-10-25:', |
40 | - 'content' => ['created_at' => ['op' => 'between','val1' => '2016-10-20','val2' => '2016-10-25']] |
|
40 | + 'content' => ['created_at' => ['op' => 'between', 'val1' => '2016-10-20', 'val2' => '2016-10-25']] |
|
41 | 41 | ], |
42 | 42 | [ |
43 | 43 | 'title' => 'user id in 1,2,3:', |
44 | - 'content' => ['id' => ['op' => 'in','val' => [1, 2, 3]]] |
|
44 | + 'content' => ['id' => ['op' => 'in', 'val' => [1, 2, 3]]] |
|
45 | 45 | ], |
46 | 46 | [ |
47 | 47 | 'title' => 'user name is null:', |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ], |
54 | 54 | [ |
55 | 55 | 'title' => 'user has group admin:', |
56 | - 'content' => ['groups' => ['op' => 'has','val' => ['name' => 'Admin']]] |
|
56 | + 'content' => ['groups' => ['op' => 'has', 'val' => ['name' => 'Admin']]] |
|
57 | 57 | ] |
58 | 58 | ]; |
59 | 59 |
@@ -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 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * Assign the permissions to the admin group. |
23 | 23 | */ |
24 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['notifications', 'pushNotificationDevices'])->each(function ($permission) use ($adminGroupId) { |
|
24 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['notifications', 'pushNotificationDevices'])->each(function($permission) use ($adminGroupId) { |
|
25 | 25 | \DB::table('groups_permissions')->insert( |
26 | 26 | [ |
27 | 27 | 'permission_id' => $permission->id, |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function run() |
15 | 15 | { |
16 | - $permissions = \DB::table('permissions')->whereIn('model', ['reports']); |
|
16 | + $permissions = \DB::table('permissions')->whereIn('model', ['reports']); |
|
17 | 17 | \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
18 | 18 | $permissions->delete(); |
19 | 19 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * Assign the permissions to the admin group. |
23 | 23 | */ |
24 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['reports'])->each(function ($permission) use ($adminGroupId) { |
|
24 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['reports'])->each(function($permission) use ($adminGroupId) { |
|
25 | 25 | \DB::table('groups_permissions')->insert( |
26 | 26 | [ |
27 | 27 | 'permission_id' => $permission->id, |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$factory->define(App\Modules\V1\Acl\AclUser::class, function (Faker\Generator $faker) { |
|
3 | +$factory->define(App\Modules\V1\Acl\AclUser::class, function(Faker\Generator $faker) { |
|
4 | 4 | return [ |
5 | 5 | 'name' => $faker->name(), |
6 | 6 | 'email' => $faker->safeEmail(), |