Completed
Push — master ( cf2713...aee5ae )
by Sherif
02:07
created
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/Roles/Database/Factories/RoleFactory.php 2 patches
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Roles\Role::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Roles\Role::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
         'name'       => $faker->unique->word(),
6 6
         'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
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/ModelObservers/RoleObserver.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -6,69 +6,69 @@
 block discarded – undo
6 6
 class RoleObserver
7 7
 {
8 8
 
9
-    public function saving($model)
10
-    {
11
-        //
12
-    }
9
+	public function saving($model)
10
+	{
11
+		//
12
+	}
13 13
 
14
-    public function saved($model)
15
-    {
16
-        //
17
-    }
14
+	public function saved($model)
15
+	{
16
+		//
17
+	}
18 18
 
19
-    public function creating($model)
20
-    {
21
-        //
22
-    }
19
+	public function creating($model)
20
+	{
21
+		//
22
+	}
23 23
 
24
-    public function created($model)
25
-    {
26
-        //
27
-    }
24
+	public function created($model)
25
+	{
26
+		//
27
+	}
28 28
 
29
-    /**
30
-     * Prevent updating of the admin role.
31
-     *
32
-     * @param  object $model the model beign updated.
33
-     * @return void
34
-     */
35
-    public function updating($model)
36
-    {
37
-        if ($model->getOriginal('name') == 'Admin') {
38
-            \ErrorHandler::noPermissions();
39
-        }
40
-    }
29
+	/**
30
+	 * Prevent updating of the admin role.
31
+	 *
32
+	 * @param  object $model the model beign updated.
33
+	 * @return void
34
+	 */
35
+	public function updating($model)
36
+	{
37
+		if ($model->getOriginal('name') == 'Admin') {
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 role.
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
-            \ErrorHandler::noPermissions();
57
-        }
58
-    }
47
+	/**
48
+	 * Prevent deleting the admin role.
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
+			\ErrorHandler::noPermissions();
57
+		}
58
+	}
59 59
 
60
-    public function deleted($model)
61
-    {
62
-        //
63
-    }
60
+	public function deleted($model)
61
+	{
62
+		//
63
+	}
64 64
 
65
-    public function restoring($model)
66
-    {
67
-        //
68
-    }
65
+	public function restoring($model)
66
+	{
67
+		//
68
+	}
69 69
 
70
-    public function restored($model)
71
-    {
72
-        //
73
-    }
70
+	public function restored($model)
71
+	{
72
+		//
73
+	}
74 74
 }
Please login to merge, or discard this patch.
Database/Migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@
 block discarded – undo
6 6
 
7 7
 class CreateOauthRefreshTokensTable extends Migration
8 8
 {
9
-    /**
10
-     * Run the migrations.
11
-     *
12
-     * @return void
13
-     */
14
-    public function up()
15
-    {
16
-        Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
17
-            $table->string('id', 100)->primary();
18
-            $table->string('access_token_id', 100);
19
-            $table->boolean('revoked');
20
-            $table->dateTime('expires_at')->nullable();
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
17
+			$table->string('id', 100)->primary();
18
+			$table->string('access_token_id', 100);
19
+			$table->boolean('revoked');
20
+			$table->dateTime('expires_at')->nullable();
21 21
 
22
-            $table->foreign('access_token_id')->references('id')->on('oauth_access_tokens');
23
-        });
24
-    }
22
+			$table->foreign('access_token_id')->references('id')->on('oauth_access_tokens');
23
+		});
24
+	}
25 25
 
26
-    /**
27
-     * Reverse the migrations.
28
-     *
29
-     * @return void
30
-     */
31
-    public function down()
32
-    {
33
-        Schema::drop('oauth_refresh_tokens');
34
-    }
26
+	/**
27
+	 * Reverse the migrations.
28
+	 *
29
+	 * @return void
30
+	 */
31
+	public function down()
32
+	{
33
+		Schema::drop('oauth_refresh_tokens');
34
+	}
35 35
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
16
+        Schema::create('oauth_refresh_tokens', function(Blueprint $table) {
17 17
             $table->string('id', 100)->primary();
18 18
             $table->string('access_token_id', 100);
19 19
             $table->boolean('revoked');
Please login to merge, or discard this patch.
src/Modules/Users/Http/Requests/AssignGroups.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 AssignRoles 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
-            'role_ids' => 'required|exists:roles,id',
28
-            'user_id'   => 'required|exists:users,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
+			'role_ids' => 'required|exists:roles,id',
28
+			'user_id'   => 'required|exists:users,id'
29
+		];
30
+	}
31 31
 }
Please login to merge, or discard this patch.
src/Modules/Permissions/Database/Factories/PermissionFactory.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\Permissions\Permission::class, function (Faker\Generator $faker) {
4
-    return [
5
-        'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6
-        'model'      => $faker->randomElement(['users', 'roles', 'settings', 'notifications']),
7
-        'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
8
-        'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
9
-    ];
4
+	return [
5
+		'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6
+		'model'      => $faker->randomElement(['users', 'roles', 'settings', 'notifications']),
7
+		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
8
+		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
9
+	];
10 10
 });
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Permissions\Permission::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Permissions\Permission::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
         'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6 6
         'model'      => $faker->randomElement(['users', 'roles', 'settings', 'notifications']),
Please login to merge, or discard this patch.