Completed
Push — master ( 8023d3...8b2ccd )
by Sherif
10:04
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.
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/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.
src/Modules/Permissions/Http/Resources/Permission.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -7,24 +7,24 @@
 block discarded – undo
7 7
 
8 8
 class Permission extends JsonResource
9 9
 {
10
-    /**
11
-     * Transform the resource into an array.
12
-     *
13
-     * @param Request $request
14
-     * @return array
15
-     */
16
-    public function toArray($request)
17
-    {
18
-        if (! $this->resource) {
19
-            return [];
20
-        }
10
+	/**
11
+	 * Transform the resource into an array.
12
+	 *
13
+	 * @param Request $request
14
+	 * @return array
15
+	 */
16
+	public function toArray($request)
17
+	{
18
+		if (! $this->resource) {
19
+			return [];
20
+		}
21 21
 
22
-        return [
23
-            'id' => $this->id,
24
-            'name' => $this->name,
25
-            'roles' => RoleResource::collection($this->whenLoaded('roles')),
26
-            'created_at' => $this->created_at,
27
-            'updated_at' => $this->updated_at,
28
-        ];
29
-    }
22
+		return [
23
+			'id' => $this->id,
24
+			'name' => $this->name,
25
+			'roles' => RoleResource::collection($this->whenLoaded('roles')),
26
+			'created_at' => $this->created_at,
27
+			'updated_at' => $this->updated_at,
28
+		];
29
+	}
30 30
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function toArray($request)
19 19
     {
20
-        if (! $this->resource) {
20
+        if ( ! $this->resource) {
21 21
             return [];
22 22
         }
23 23
 
Please login to merge, or discard this patch.
src/Modules/Permissions/Repositories/PermissionRepository.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@
 block discarded – undo
5 5
 
6 6
 class PermissionRepository extends BaseRepository
7 7
 {
8
-    /**
9
-     * Init new object.
10
-     *
11
-     * @param   Permission $model
12
-     * @return  void
13
-     */
14
-    public function __construct(Permission $model)
15
-    {
16
-        parent::__construct($model);
17
-    }
8
+	/**
9
+	 * Init new object.
10
+	 *
11
+	 * @param   Permission $model
12
+	 * @return  void
13
+	 */
14
+	public function __construct(Permission $model)
15
+	{
16
+		parent::__construct($model);
17
+	}
18 18
 }
Please login to merge, or discard this patch.
src/Modules/Permissions/ModelObservers/PermissionObserver.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -6,53 +6,53 @@
 block discarded – undo
6 6
 class PermissionObserver
7 7
 {
8 8
 
9
-    public function saving($model)
10
-    {
11
-        //
12
-    }
13
-
14
-    public function saved($model)
15
-    {
16
-        //
17
-    }
18
-
19
-    public function creating($model)
20
-    {
21
-        //
22
-    }
23
-
24
-    public function created($model)
25
-    {
26
-        //
27
-    }
28
-
29
-    public function updating($model)
30
-    {
31
-        //
32
-    }
33
-
34
-    public function updated($model)
35
-    {
36
-        //
37
-    }
38
-
39
-    public function deleting($model)
40
-    {
41
-        //
42
-    }
43
-
44
-    public function deleted($model)
45
-    {
46
-        //
47
-    }
48
-
49
-    public function restoring($model)
50
-    {
51
-        //
52
-    }
53
-
54
-    public function restored($model)
55
-    {
56
-        //
57
-    }
9
+	public function saving($model)
10
+	{
11
+		//
12
+	}
13
+
14
+	public function saved($model)
15
+	{
16
+		//
17
+	}
18
+
19
+	public function creating($model)
20
+	{
21
+		//
22
+	}
23
+
24
+	public function created($model)
25
+	{
26
+		//
27
+	}
28
+
29
+	public function updating($model)
30
+	{
31
+		//
32
+	}
33
+
34
+	public function updated($model)
35
+	{
36
+		//
37
+	}
38
+
39
+	public function deleting($model)
40
+	{
41
+		//
42
+	}
43
+
44
+	public function deleted($model)
45
+	{
46
+		//
47
+	}
48
+
49
+	public function restoring($model)
50
+	{
51
+		//
52
+	}
53
+
54
+	public function restored($model)
55
+	{
56
+		//
57
+	}
58 58
 }
Please login to merge, or discard this patch.
Database/Migrations/2016_01_24_111942_push_notification_devices.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('push_notification_devices', function (Blueprint $table) {
15
+        Schema::create('push_notification_devices', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('device_token');
18 18
             $table->unsignedInteger('user_id');
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -5,33 +5,33 @@
 block discarded – undo
5 5
 
6 6
 class PushNotificationDevices extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('push_notification_devices', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('device_token');
18
-            $table->unsignedInteger('user_id');
19
-            $table->text('access_token')->nullable();
20
-            $table->unique(array('device_token', 'user_id'));
21
-            $table->softDeletes();
22
-            $table->timestamps();
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('push_notification_devices', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('device_token');
18
+			$table->unsignedInteger('user_id');
19
+			$table->text('access_token')->nullable();
20
+			$table->unique(array('device_token', 'user_id'));
21
+			$table->softDeletes();
22
+			$table->timestamps();
23 23
             
24
-            $table->foreign('user_id')->references('id')->on('users');
25
-        });
26
-    }
24
+			$table->foreign('user_id')->references('id')->on('users');
25
+		});
26
+	}
27 27
 
28
-    /**
29
-     * Reverse the migrations.
30
-     *
31
-     * @return void
32
-     */
33
-    public function down()
34
-    {
35
-        Schema::dropIfExists('push_notification_devices');
36
-    }
28
+	/**
29
+	 * Reverse the migrations.
30
+	 *
31
+	 * @return void
32
+	 */
33
+	public function down()
34
+	{
35
+		Schema::dropIfExists('push_notification_devices');
36
+	}
37 37
 }
Please login to merge, or discard this patch.
Database/Migrations/2016_06_01_000004_create_oauth_auth_codes_table.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -6,33 +6,33 @@
 block discarded – undo
6 6
 
7 7
 class CreateOauthAuthCodesTable extends Migration
8 8
 {
9
-    /**
10
-     * Run the migrations.
11
-     *
12
-     * @return void
13
-     */
14
-    public function up()
15
-    {
16
-        Schema::create('oauth_auth_codes', function (Blueprint $table) {
17
-            $table->string('id', 100)->primary();
18
-            $table->unsignedInteger('user_id');
19
-            $table->unsignedInteger('client_id');
20
-            $table->text('scopes')->nullable();
21
-            $table->boolean('revoked');
22
-            $table->dateTime('expires_at')->nullable();
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('oauth_auth_codes', function (Blueprint $table) {
17
+			$table->string('id', 100)->primary();
18
+			$table->unsignedInteger('user_id');
19
+			$table->unsignedInteger('client_id');
20
+			$table->text('scopes')->nullable();
21
+			$table->boolean('revoked');
22
+			$table->dateTime('expires_at')->nullable();
23 23
 
24
-            $table->foreign('user_id')->references('id')->on('users');
25
-            $table->foreign('client_id')->references('id')->on('oauth_clients');
26
-        });
27
-    }
24
+			$table->foreign('user_id')->references('id')->on('users');
25
+			$table->foreign('client_id')->references('id')->on('oauth_clients');
26
+		});
27
+	}
28 28
 
29
-    /**
30
-     * Reverse the migrations.
31
-     *
32
-     * @return void
33
-     */
34
-    public function down()
35
-    {
36
-        Schema::drop('oauth_auth_codes');
37
-    }
29
+	/**
30
+	 * Reverse the migrations.
31
+	 *
32
+	 * @return void
33
+	 */
34
+	public function down()
35
+	{
36
+		Schema::drop('oauth_auth_codes');
37
+	}
38 38
 }
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_auth_codes', function (Blueprint $table) {
16
+        Schema::create('oauth_auth_codes', function(Blueprint $table) {
17 17
             $table->string('id', 100)->primary();
18 18
             $table->unsignedInteger('user_id');
19 19
             $table->unsignedInteger('client_id');
Please login to merge, or discard this patch.