Completed
Push — master ( a0772e...0d52ea )
by Sherif
01:55
created
src/Modules/Permissions/Routes/api.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
 
16 16
 Route::group(['prefix' => 'permissions'], function () {
17 17
         
18
-    Route::get('/', 'PermissionController@index');
19
-    Route::get('/{id}', 'PermissionController@find');
18
+	Route::get('/', 'PermissionController@index');
19
+	Route::get('/{id}', 'PermissionController@find');
20 20
 });
Please login to merge, or discard this patch.
src/Modules/Core/Database/Factories/SettingFactory.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\Core\Setting::class, function (Faker\Generator $faker) {
4
-    return [
5
-        'name'       => $faker->randomElement(['Company Name', 'Title', 'Header Image']),
6
-        'value'      => $faker->word(),
7
-        'key'        => $faker->word(),
8
-        'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
9
-        'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
10
-    ];
4
+	return [
5
+		'name'       => $faker->randomElement(['Company Name', 'Title', 'Header Image']),
6
+		'value'      => $faker->word(),
7
+		'key'        => $faker->word(),
8
+		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
9
+		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
10
+	];
11 11
 });
Please login to merge, or discard this patch.
src/Modules/Core/Http/Middleware/SetRelations.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -9,43 +9,43 @@
 block discarded – undo
9 9
 
10 10
 class SetRelations
11 11
 {
12
-    protected $arr;
13
-    protected $route;
14
-    protected $config;
12
+	protected $arr;
13
+	protected $route;
14
+	protected $config;
15 15
     
16
-    /**
17
-     * Init new object.
18
-     *
19
-     * @param   Route  $route
20
-     * @param   Arr    $arr
21
-     * @param   Config $config
22
-     *
23
-     * @return  void
24
-     */
25
-    public function __construct(Route $route, Arr $arr, Config $config)
26
-    {
27
-        $this->arr = $arr;
28
-        $this->route = $route;
29
-        $this->config = $config->getConfig();
30
-    }
16
+	/**
17
+	 * Init new object.
18
+	 *
19
+	 * @param   Route  $route
20
+	 * @param   Arr    $arr
21
+	 * @param   Config $config
22
+	 *
23
+	 * @return  void
24
+	 */
25
+	public function __construct(Route $route, Arr $arr, Config $config)
26
+	{
27
+		$this->arr = $arr;
28
+		$this->route = $route;
29
+		$this->config = $config->getConfig();
30
+	}
31 31
 
32
-    /**
33
-     * Handle an incoming request.
34
-     *
35
-     * @param  \Illuminate\Http\Request  $request
36
-     * @param  \Closure  $next
37
-     * @return mixed
38
-     */
39
-    public function handle($request, Closure $next)
40
-    {
41
-        $routeActions       = explode('@', $this->route->currentRouteAction());
42
-        $modelName          = explode('\\', $routeActions[0]);
43
-        $modelName          = lcfirst(str_replace('Controller', '', end($modelName)));
44
-        $route              = explode('@', $this->route->currentRouteAction())[1];
45
-        $route              = $route !== 'index' ? $route : 'list';
46
-        $relations          = $this->arr->get($this->config['relations'], $modelName, false);
47
-        $request->relations = $relations && isset($relations[$route]) ? $relations[$route] : [];
32
+	/**
33
+	 * Handle an incoming request.
34
+	 *
35
+	 * @param  \Illuminate\Http\Request  $request
36
+	 * @param  \Closure  $next
37
+	 * @return mixed
38
+	 */
39
+	public function handle($request, Closure $next)
40
+	{
41
+		$routeActions       = explode('@', $this->route->currentRouteAction());
42
+		$modelName          = explode('\\', $routeActions[0]);
43
+		$modelName          = lcfirst(str_replace('Controller', '', end($modelName)));
44
+		$route              = explode('@', $this->route->currentRouteAction())[1];
45
+		$route              = $route !== 'index' ? $route : 'list';
46
+		$relations          = $this->arr->get($this->config['relations'], $modelName, false);
47
+		$request->relations = $relations && isset($relations[$route]) ? $relations[$route] : [];
48 48
 
49
-        return $next($request);
50
-    }
49
+		return $next($request);
50
+	}
51 51
 }
Please login to merge, or discard this patch.
src/Modules/Reporting/Routes/api.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
 Route::group(['prefix' => 'reports'], function () {
15 15
         
16
-    Route::get('/', 'ReportController@index');
17
-    Route::get('/{id}', 'ReportController@find');
18
-    Route::post('get/{reportName}', 'ReportController@getReport');
16
+	Route::get('/', 'ReportController@index');
17
+	Route::get('/{id}', 'ReportController@find');
18
+	Route::post('get/{reportName}', 'ReportController@getReport');
19 19
 });
Please login to merge, or discard this patch.
src/Modules/Roles/Database/Factories/RoleFactory.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\Roles\Role::class, function (Faker\Generator $faker) {
4
-    return [
5
-        'name'       => $faker->unique->word(),
6
-        'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
7
-        'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
8
-    ];
4
+	return [
5
+		'name'       => $faker->unique->word(),
6
+		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
7
+		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
8
+	];
9 9
 });
Please login to merge, or discard this patch.
src/Modules/Roles/Http/Requests/AssignPermissions.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@
 block discarded – undo
6 6
 
7 7
 class AssignPermissions extends FormRequest
8 8
 {
9
-    /**
10
-     * Determine if the user is authorized to make this request.
11
-     *
12
-     * @return bool
13
-     */
14
-    public function authorize()
15
-    {
16
-        return true;
17
-    }
9
+	/**
10
+	 * Determine if the user is authorized to make this request.
11
+	 *
12
+	 * @return bool
13
+	 */
14
+	public function authorize()
15
+	{
16
+		return true;
17
+	}
18 18
 
19
-    /**
20
-     * Get the validation rules that apply to the request.
21
-     *
22
-     * @return array
23
-     */
24
-    public function rules()
25
-    {
26
-        return [
27
-            'permission_ids' => 'required|exists:permissions,id',
28
-            'role_id'       => 'required|array|exists:roles,id'
29
-        ];
30
-    }
19
+	/**
20
+	 * Get the validation rules that apply to the request.
21
+	 *
22
+	 * @return array
23
+	 */
24
+	public function rules()
25
+	{
26
+		return [
27
+			'permission_ids' => 'required|exists:permissions,id',
28
+			'role_id'       => 'required|array|exists:roles,id'
29
+		];
30
+	}
31 31
 }
Please login to merge, or discard this patch.
src/Modules/Roles/Http/Requests/UpdateRole.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@
 block discarded – undo
6 6
 
7 7
 class UpdateRole extends FormRequest
8 8
 {
9
-    /**
10
-     * Determine if the user is authorized to make this request.
11
-     *
12
-     * @return bool
13
-     */
14
-    public function authorize()
15
-    {
16
-        return true;
17
-    }
9
+	/**
10
+	 * Determine if the user is authorized to make this request.
11
+	 *
12
+	 * @return bool
13
+	 */
14
+	public function authorize()
15
+	{
16
+		return true;
17
+	}
18 18
 
19
-    /**
20
-     * Get the validation rules that apply to the request.
21
-     *
22
-     * @return array
23
-     */
24
-    public function rules()
25
-    {
26
-        return [
27
-            'id'   => 'required|exists:roles,id',
28
-            'name' => 'required|string|max:100|unique:roles,name,'.$this->get('id')
29
-        ];
30
-    }
19
+	/**
20
+	 * Get the validation rules that apply to the request.
21
+	 *
22
+	 * @return array
23
+	 */
24
+	public function rules()
25
+	{
26
+		return [
27
+			'id'   => 'required|exists:roles,id',
28
+			'name' => 'required|string|max:100|unique:roles,name,'.$this->get('id')
29
+		];
30
+	}
31 31
 }
Please login to merge, or discard this patch.
src/Modules/Roles/Http/Requests/InsertRole.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,25 +6,25 @@
 block discarded – undo
6 6
 
7 7
 class InsertRole extends FormRequest
8 8
 {
9
-    /**
10
-     * Determine if the user is authorized to make this request.
11
-     *
12
-     * @return bool
13
-     */
14
-    public function authorize()
15
-    {
16
-        return true;
17
-    }
9
+	/**
10
+	 * Determine if the user is authorized to make this request.
11
+	 *
12
+	 * @return bool
13
+	 */
14
+	public function authorize()
15
+	{
16
+		return true;
17
+	}
18 18
 
19
-    /**
20
-     * Get the validation rules that apply to the request.
21
-     *
22
-     * @return array
23
-     */
24
-    public function rules()
25
-    {
26
-        return [
27
-            'name' => 'required|string|max:100|unique:roles,name,'.$this->get('id')
28
-        ];
29
-    }
19
+	/**
20
+	 * Get the validation rules that apply to the request.
21
+	 *
22
+	 * @return array
23
+	 */
24
+	public function rules()
25
+	{
26
+		return [
27
+			'name' => 'required|string|max:100|unique:roles,name,'.$this->get('id')
28
+		];
29
+	}
30 30
 }
Please login to merge, or discard this patch.
src/Modules/Roles/Http/Resources/Role.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -8,25 +8,25 @@
 block discarded – undo
8 8
 
9 9
 class Role extends JsonResource
10 10
 {
11
-    /**
12
-     * Transform the resource into an array.
13
-     *
14
-     * @param Request $request
15
-     * @return array
16
-     */
17
-    public function toArray($request)
18
-    {
19
-        if (! $this->resource) {
20
-            return [];
21
-        }
11
+	/**
12
+	 * Transform the resource into an array.
13
+	 *
14
+	 * @param Request $request
15
+	 * @return array
16
+	 */
17
+	public function toArray($request)
18
+	{
19
+		if (! $this->resource) {
20
+			return [];
21
+		}
22 22
 
23
-        return [
24
-            'id' => $this->id,
25
-            'name' => $this->name,
26
-            'users' => UserResource::collection($this->whenLoaded('users')),
27
-            'permissions' => PermissionResource::collection($this->whenLoaded('permissions')),
28
-            'created_at' => $this->created_at,
29
-            'updated_at' => $this->updated_at,
30
-        ];
31
-    }
23
+		return [
24
+			'id' => $this->id,
25
+			'name' => $this->name,
26
+			'users' => UserResource::collection($this->whenLoaded('users')),
27
+			'permissions' => PermissionResource::collection($this->whenLoaded('permissions')),
28
+			'created_at' => $this->created_at,
29
+			'updated_at' => $this->updated_at,
30
+		];
31
+	}
32 32
 }
Please login to merge, or discard this patch.