Completed
Push — master ( b6d2bb...2d22de )
by Sherif
05:28
created
src/Modules/Acl/ModelObservers/AclGroupObserver.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 AclGroupObserver
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 group.
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 group.
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 group.
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 group.
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.
src/Modules/Acl/ModelObservers/OauthClientObserver.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -8,53 +8,53 @@
 block discarded – undo
8 8
 class OauthClientObserver
9 9
 {
10 10
 
11
-    public function saving($model)
12
-    {
13
-        //
14
-    }
15
-
16
-    public function saved($model)
17
-    {
18
-        //
19
-    }
20
-
21
-    public function creating($model)
22
-    {
23
-        $model->secret = Str::random(40);
24
-    }
25
-
26
-    public function created($model)
27
-    {
28
-        //
29
-    }
30
-
31
-    public function updating($model)
32
-    {
33
-        //
34
-    }
35
-
36
-    public function updated($model)
37
-    {
38
-        //
39
-    }
40
-
41
-    public function deleting($model)
42
-    {
43
-        //
44
-    }
45
-
46
-    public function deleted($model)
47
-    {
48
-        //
49
-    }
50
-
51
-    public function restoring($model)
52
-    {
53
-        //
54
-    }
55
-
56
-    public function restored($model)
57
-    {
58
-        //
59
-    }
11
+	public function saving($model)
12
+	{
13
+		//
14
+	}
15
+
16
+	public function saved($model)
17
+	{
18
+		//
19
+	}
20
+
21
+	public function creating($model)
22
+	{
23
+		$model->secret = Str::random(40);
24
+	}
25
+
26
+	public function created($model)
27
+	{
28
+		//
29
+	}
30
+
31
+	public function updating($model)
32
+	{
33
+		//
34
+	}
35
+
36
+	public function updated($model)
37
+	{
38
+		//
39
+	}
40
+
41
+	public function deleting($model)
42
+	{
43
+		//
44
+	}
45
+
46
+	public function deleted($model)
47
+	{
48
+		//
49
+	}
50
+
51
+	public function restoring($model)
52
+	{
53
+		//
54
+	}
55
+
56
+	public function restored($model)
57
+	{
58
+		//
59
+	}
60 60
 }
Please login to merge, or discard this patch.
src/Modules/Acl/ModelObservers/AclUserObserver.php 2 patches
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -6,62 +6,62 @@
 block discarded – undo
6 6
 class AclUserObserver
7 7
 {
8 8
 
9
-    public function saving($model)
10
-    {
11
-        if ($model->isDirty('profile_picture')) {
12
-            \Media::deleteImage($model->getOriginal('profile_picture'));
13
-        }
14
-    }
9
+	public function saving($model)
10
+	{
11
+		if ($model->isDirty('profile_picture')) {
12
+			\Media::deleteImage($model->getOriginal('profile_picture'));
13
+		}
14
+	}
15 15
 
16
-    public function saved($model)
17
-    {
18
-        //
19
-    }
16
+	public function saved($model)
17
+	{
18
+		//
19
+	}
20 20
 
21
-    public function creating($model)
22
-    {
23
-        //
24
-    }
21
+	public function creating($model)
22
+	{
23
+		//
24
+	}
25 25
 
26
-    public function created($model)
27
-    {
28
-        //
29
-    }
26
+	public function created($model)
27
+	{
28
+		//
29
+	}
30 30
 
31
-    public function updating($model)
32
-    {
33
-        //
34
-    }
31
+	public function updating($model)
32
+	{
33
+		//
34
+	}
35 35
 
36
-    public function updated($model)
37
-    {
38
-        if ($model->isDirty('blocked') && $model->blocked) {
39
-            $model->tokens()->each(function ($token) {
36
+	public function updated($model)
37
+	{
38
+		if ($model->isDirty('blocked') && $model->blocked) {
39
+			$model->tokens()->each(function ($token) {
40 40
 
41
-                \Core::users()->revokeAccessToken($token);
42
-            });
43
-        }
44
-    }
41
+				\Core::users()->revokeAccessToken($token);
42
+			});
43
+		}
44
+	}
45 45
 
46
-    public function deleting($model)
47
-    {
48
-        if ($model->getOriginal('id') == \Auth::id()) {
49
-            \ErrorHandler::noPermissions();
50
-        }
51
-    }
46
+	public function deleting($model)
47
+	{
48
+		if ($model->getOriginal('id') == \Auth::id()) {
49
+			\ErrorHandler::noPermissions();
50
+		}
51
+	}
52 52
 
53
-    public function deleted($model)
54
-    {
55
-        //
56
-    }
53
+	public function deleted($model)
54
+	{
55
+		//
56
+	}
57 57
 
58
-    public function restoring($model)
59
-    {
60
-        //
61
-    }
58
+	public function restoring($model)
59
+	{
60
+		//
61
+	}
62 62
 
63
-    public function restored($model)
64
-    {
65
-        //
66
-    }
63
+	public function restored($model)
64
+	{
65
+		//
66
+	}
67 67
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     public function updated($model)
37 37
     {
38 38
         if ($model->isDirty('blocked') && $model->blocked) {
39
-            $model->tokens()->each(function ($token) {
39
+            $model->tokens()->each(function($token) {
40 40
 
41 41
                 \Core::users()->revokeAccessToken($token);
42 42
             });
Please login to merge, or discard this patch.
src/Modules/Acl/AclGroup.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -6,42 +6,42 @@
 block discarded – undo
6 6
 class AclGroup extends Model
7 7
 {
8 8
 
9
-    use SoftDeletes;
10
-    protected $table    = 'groups';
11
-    protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
12
-    protected $hidden   = ['deleted_at'];
13
-    protected $guarded  = ['id'];
14
-    protected $fillable = ['name'];
15
-    public $searchable  = ['name'];
16
-
17
-    public function getCreatedAtAttribute($value)
18
-    {
19
-        return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
20
-    }
21
-
22
-    public function getUpdatedAtAttribute($value)
23
-    {
24
-        return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
25
-    }
26
-
27
-    public function getDeletedAtAttribute($value)
28
-    {
29
-        return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
30
-    }
31
-
32
-    public function users()
33
-    {
34
-        return $this->belongsToMany('\App\Modules\Acl\AclUser', 'users_groups', 'group_id', 'user_id')->whereNull('users_groups.deleted_at')->withTimestamps();
35
-    }
36
-
37
-    public function permissions()
38
-    {
39
-        return $this->belongsToMany('\App\Modules\Acl\AclPermission', 'groups_permissions', 'group_id', 'permission_id')->whereNull('groups_permissions.deleted_at')->withTimestamps();
40
-    }
41
-
42
-    public static function boot()
43
-    {
44
-        parent::boot();
45
-        AclGroup::observe(\App::make('App\Modules\Acl\ModelObservers\AclGroupObserver'));
46
-    }
9
+	use SoftDeletes;
10
+	protected $table    = 'groups';
11
+	protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
12
+	protected $hidden   = ['deleted_at'];
13
+	protected $guarded  = ['id'];
14
+	protected $fillable = ['name'];
15
+	public $searchable  = ['name'];
16
+
17
+	public function getCreatedAtAttribute($value)
18
+	{
19
+		return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
20
+	}
21
+
22
+	public function getUpdatedAtAttribute($value)
23
+	{
24
+		return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
25
+	}
26
+
27
+	public function getDeletedAtAttribute($value)
28
+	{
29
+		return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
30
+	}
31
+
32
+	public function users()
33
+	{
34
+		return $this->belongsToMany('\App\Modules\Acl\AclUser', 'users_groups', 'group_id', 'user_id')->whereNull('users_groups.deleted_at')->withTimestamps();
35
+	}
36
+
37
+	public function permissions()
38
+	{
39
+		return $this->belongsToMany('\App\Modules\Acl\AclPermission', 'groups_permissions', 'group_id', 'permission_id')->whereNull('groups_permissions.deleted_at')->withTimestamps();
40
+	}
41
+
42
+	public static function boot()
43
+	{
44
+		parent::boot();
45
+		AclGroup::observe(\App::make('App\Modules\Acl\ModelObservers\AclGroupObserver'));
46
+	}
47 47
 }
Please login to merge, or discard this patch.
src/Modules/Acl/AclPermission.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -6,37 +6,37 @@
 block discarded – undo
6 6
 class AclPermission extends Model
7 7
 {
8 8
 
9
-    use SoftDeletes;
10
-    protected $table    = 'permissions';
11
-    protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
12
-    protected $hidden   = ['deleted_at'];
13
-    protected $guarded  = ['id'];
14
-    protected $fillable = ['name', 'model'];
15
-    public $searchable  = ['name', 'model'];
9
+	use SoftDeletes;
10
+	protected $table    = 'permissions';
11
+	protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
12
+	protected $hidden   = ['deleted_at'];
13
+	protected $guarded  = ['id'];
14
+	protected $fillable = ['name', 'model'];
15
+	public $searchable  = ['name', 'model'];
16 16
 
17
-    public function getCreatedAtAttribute($value)
18
-    {
19
-        return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
20
-    }
17
+	public function getCreatedAtAttribute($value)
18
+	{
19
+		return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
20
+	}
21 21
 
22
-    public function getUpdatedAtAttribute($value)
23
-    {
24
-        return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
25
-    }
22
+	public function getUpdatedAtAttribute($value)
23
+	{
24
+		return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
25
+	}
26 26
 
27
-    public function getDeletedAtAttribute($value)
28
-    {
29
-        return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
30
-    }
27
+	public function getDeletedAtAttribute($value)
28
+	{
29
+		return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
30
+	}
31 31
     
32
-    public function groups()
33
-    {
34
-        return $this->belongsToMany('\App\Modules\Acl\AclGroup', 'groups_permissions', 'permission_id', 'group_id')->whereNull('groups_permissions.deleted_at')->withTimestamps();
35
-    }
32
+	public function groups()
33
+	{
34
+		return $this->belongsToMany('\App\Modules\Acl\AclGroup', 'groups_permissions', 'permission_id', 'group_id')->whereNull('groups_permissions.deleted_at')->withTimestamps();
35
+	}
36 36
 
37
-    public static function boot()
38
-    {
39
-        parent::boot();
40
-        AclPermission::observe(\App::make('App\Modules\Acl\ModelObservers\AclPermissionObserver'));
41
-    }
37
+	public static function boot()
38
+	{
39
+		parent::boot();
40
+		AclPermission::observe(\App::make('App\Modules\Acl\ModelObservers\AclPermissionObserver'));
41
+	}
42 42
 }
Please login to merge, or discard this patch.
src/Modules/Acl/Repositories/PermissionRepository.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 
5 5
 class PermissionRepository extends AbstractRepository
6 6
 {
7
-    /**
8
-     * Return the model full namespace.
9
-     *
10
-     * @return string
11
-     */
12
-    protected function getModel()
13
-    {
14
-        return 'App\Modules\Acl\AclPermission';
15
-    }
7
+	/**
8
+	 * Return the model full namespace.
9
+	 *
10
+	 * @return string
11
+	 */
12
+	protected function getModel()
13
+	{
14
+		return 'App\Modules\Acl\AclPermission';
15
+	}
16 16
 }
Please login to merge, or discard this patch.
src/Modules/Acl/Repositories/GroupRepository.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -4,31 +4,31 @@
 block discarded – undo
4 4
 
5 5
 class GroupRepository extends AbstractRepository
6 6
 {
7
-    /**
8
-     * Return the model full namespace.
9
-     *
10
-     * @return string
11
-     */
12
-    protected function getModel()
13
-    {
14
-        return 'App\Modules\Acl\AclGroup';
15
-    }
7
+	/**
8
+	 * Return the model full namespace.
9
+	 *
10
+	 * @return string
11
+	 */
12
+	protected function getModel()
13
+	{
14
+		return 'App\Modules\Acl\AclGroup';
15
+	}
16 16
 
17
-    /**
18
-     * Assign the given permission ids to the given group.
19
-     *
20
-     * @param  integer $groupId
21
-     * @param  array   $permissionIds
22
-     * @return object
23
-     */
24
-    public function assignPermissions($groupId, $permissionIds)
25
-    {
26
-        \DB::transaction(function () use ($groupId, $permissionIds) {
27
-            $group = $this->find($groupId);
28
-            $group->permissions()->detach();
29
-            $group->permissions()->attach($permissionIds);
30
-        });
17
+	/**
18
+	 * Assign the given permission ids to the given group.
19
+	 *
20
+	 * @param  integer $groupId
21
+	 * @param  array   $permissionIds
22
+	 * @return object
23
+	 */
24
+	public function assignPermissions($groupId, $permissionIds)
25
+	{
26
+		\DB::transaction(function () use ($groupId, $permissionIds) {
27
+			$group = $this->find($groupId);
28
+			$group->permissions()->detach();
29
+			$group->permissions()->attach($permissionIds);
30
+		});
31 31
 
32
-        return $this->find($groupId);
33
-    }
32
+		return $this->find($groupId);
33
+	}
34 34
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function assignPermissions($groupId, $permissionIds)
25 25
     {
26
-        \DB::transaction(function () use ($groupId, $permissionIds) {
26
+        \DB::transaction(function() use ($groupId, $permissionIds) {
27 27
             $group = $this->find($groupId);
28 28
             $group->permissions()->detach();
29 29
             $group->permissions()->attach($permissionIds);
Please login to merge, or discard this patch.
src/Modules/Acl/Repositories/OauthClientRepository.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -4,37 +4,37 @@
 block discarded – undo
4 4
 
5 5
 class OauthClientRepository extends AbstractRepository
6 6
 {
7
-    /**
8
-     * Return the model full namespace.
9
-     *
10
-     * @return string
11
-     */
12
-    protected function getModel()
13
-    {
14
-        return 'App\Modules\Acl\OauthClient';
15
-    }
7
+	/**
8
+	 * Return the model full namespace.
9
+	 *
10
+	 * @return string
11
+	 */
12
+	protected function getModel()
13
+	{
14
+		return 'App\Modules\Acl\OauthClient';
15
+	}
16 16
 
17
-    /**
18
-     * Revoke the given client.
19
-     *
20
-     * @param  integer  $clientId
21
-     * @return void
22
-     */
23
-    public function revoke($clientId)
24
-    {
25
-        $client = $this->find($clientId);
26
-        $client->tokens()->update(['revoked' => true]);
27
-        $this->save(['id'=> $clientId, 'revoked' => true]);
28
-    }
17
+	/**
18
+	 * Revoke the given client.
19
+	 *
20
+	 * @param  integer  $clientId
21
+	 * @return void
22
+	 */
23
+	public function revoke($clientId)
24
+	{
25
+		$client = $this->find($clientId);
26
+		$client->tokens()->update(['revoked' => true]);
27
+		$this->save(['id'=> $clientId, 'revoked' => true]);
28
+	}
29 29
 
30
-    /**
31
-     * Un revoke the given client.
32
-     *
33
-     * @param  integer  $clientId
34
-     * @return void
35
-     */
36
-    public function unRevoke($clientId)
37
-    {
38
-        $this->save(['id'=> $clientId, 'revoked' => false]);
39
-    }
30
+	/**
31
+	 * Un revoke the given client.
32
+	 *
33
+	 * @param  integer  $clientId
34
+	 * @return void
35
+	 */
36
+	public function unRevoke($clientId)
37
+	{
38
+		$this->save(['id'=> $clientId, 'revoked' => false]);
39
+	}
40 40
 }
Please login to merge, or discard this patch.
src/Modules/Core/Database/Factories/SettingFactory.php 2 patches
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\Settings::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.
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\Core\Settings::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Core\Settings::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
         'name'       => $faker->randomElement(['Company Name', 'Title', 'Header Image']),
6 6
         'value'      => $faker->word(),
Please login to merge, or discard this patch.