Completed
Push — master ( 244647...7f4033 )
by Sherif
03:03
created
src/Modules/Acl/AclUser.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,5 @@
 block discarded – undo
1 1
 <?php namespace App\Modules\Acl;
2 2
 
3
-use Illuminate\Database\Eloquent\Model;
4 3
 use App\User;
5 4
 use Illuminate\Database\Eloquent\SoftDeletes;
6 5
 
Please login to merge, or discard this patch.
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -6,66 +6,66 @@
 block discarded – undo
6 6
 
7 7
 class AclUser extends User {
8 8
 
9
-    use SoftDeletes;
10
-    protected $table    = 'users';
11
-    protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
12
-    protected $hidden   = ['password', 'remember_token','deleted_at'];
13
-    protected $guarded  = ['id'];
14
-    protected $fillable = ['first_name', 'last_name', 'user_name', 'address', 'email', 'password'];
15
-    protected $appends  = ['permissions'];
9
+	use SoftDeletes;
10
+	protected $table    = 'users';
11
+	protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
12
+	protected $hidden   = ['password', 'remember_token','deleted_at'];
13
+	protected $guarded  = ['id'];
14
+	protected $fillable = ['first_name', 'last_name', 'user_name', 'address', 'email', 'password'];
15
+	protected $appends  = ['permissions'];
16 16
     
17
-    public function getCreatedAtAttribute($value)
18
-    {
19
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
20
-    }
17
+	public function getCreatedAtAttribute($value)
18
+	{
19
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
20
+	}
21 21
 
22
-    public function getUpdatedAtAttribute($value)
23
-    {
24
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
25
-    }
22
+	public function getUpdatedAtAttribute($value)
23
+	{
24
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
25
+	}
26 26
 
27
-    public function getDeletedAtAttribute($value)
28
-    {
29
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
30
-    }
27
+	public function getDeletedAtAttribute($value)
28
+	{
29
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
30
+	}
31 31
 
32
-    /**
33
-     * Encrypt the password attribute before
34
-     * saving it in the storage.
35
-     * 
36
-     * @param string $value 
37
-     */
38
-    public function setPasswordAttribute($value)
39
-    {
40
-        $this->attributes['password'] = bcrypt($value);
41
-    }
32
+	/**
33
+	 * Encrypt the password attribute before
34
+	 * saving it in the storage.
35
+	 * 
36
+	 * @param string $value 
37
+	 */
38
+	public function setPasswordAttribute($value)
39
+	{
40
+		$this->attributes['password'] = bcrypt($value);
41
+	}
42 42
 
43
-    public function logs()
44
-    {
45
-        return $this->hasMany('App\Modules\Logging\Log', 'user_id');
46
-    }
43
+	public function logs()
44
+	{
45
+		return $this->hasMany('App\Modules\Logging\Log', 'user_id');
46
+	}
47 47
 
48
-    public function groups()
49
-    {
50
-        return $this->belongsToMany('\App\Modules\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps();
51
-    }
48
+	public function groups()
49
+	{
50
+		return $this->belongsToMany('\App\Modules\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps();
51
+	}
52 52
 
53
-    public function getPermissionsAttribute()
54
-    {
55
-        $permissions = [];
56
-        foreach ($this->groups as $group)
57
-        {
58
-            $group->permissions->each(function ($permission) use (&$permissions){
59
-                $permissions[$permission->model][$permission->id] = $permission->name;
60
-            });
61
-        }
53
+	public function getPermissionsAttribute()
54
+	{
55
+		$permissions = [];
56
+		foreach ($this->groups as $group)
57
+		{
58
+			$group->permissions->each(function ($permission) use (&$permissions){
59
+				$permissions[$permission->model][$permission->id] = $permission->name;
60
+			});
61
+		}
62 62
 
63
-        return \Illuminate\Database\Eloquent\Collection::make($permissions);
64
-    }
63
+		return \Illuminate\Database\Eloquent\Collection::make($permissions);
64
+	}
65 65
 
66
-    public static function boot()
67
-    {
68
-        parent::boot();
69
-        parent::observe(\App::make('App\Modules\Acl\ModelObservers\AclUserObserver'));
70
-    }
66
+	public static function boot()
67
+	{
68
+		parent::boot();
69
+		parent::observe(\App::make('App\Modules\Acl\ModelObservers\AclUserObserver'));
70
+	}
71 71
 }
Please login to merge, or discard this patch.
src/Modules/Reporting/Report.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 class Report extends Model{
7 7
 
8
-    use SoftDeletes;
8
+	use SoftDeletes;
9 9
 	protected $table    = 'reports';
10 10
 	protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
11 11
 	protected $hidden   = ['deleted_at'];
@@ -13,23 +13,23 @@  discard block
 block discarded – undo
13 13
 	protected $fillable = ['report_name', 'view_name'];
14 14
 
15 15
 	public function getCreatedAtAttribute($value)
16
-    {
17
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
18
-    }
16
+	{
17
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
18
+	}
19 19
 
20
-    public function getUpdatedAtAttribute($value)
21
-    {
22
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
23
-    }
20
+	public function getUpdatedAtAttribute($value)
21
+	{
22
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
23
+	}
24 24
 
25
-    public function getDeletedAtAttribute($value)
26
-    {
27
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
28
-    }
25
+	public function getDeletedAtAttribute($value)
26
+	{
27
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
28
+	}
29 29
     
30
-    public static function boot()
31
-    {
32
-        parent::boot();
33
-        parent::observe(\App::make('App\Modules\Reporting\ModelObservers\ReprotObserver'));
34
-    }
30
+	public static function boot()
31
+	{
32
+		parent::boot();
33
+		parent::observe(\App::make('App\Modules\Reporting\ModelObservers\ReprotObserver'));
34
+	}
35 35
 }
Please login to merge, or discard this patch.
src/Modules/Reporting/ModelObservers/ReprotObserver.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -5,44 +5,44 @@
 block discarded – undo
5 5
  */
6 6
 class ReprotObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
12
-
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
17
-
18
-    public function creating($model)
19
-    {
20
-        //
21
-    }
22
-
23
-    public function created($model)
24
-    {
25
-        //
26
-    }
27
-
28
-    public function updating($model)
29
-    {
30
-        //
31
-    }
32
-
33
-    public function updated($model)
34
-    {
35
-        //
36
-    }
37
-
38
-    public function deleting($model)
39
-    {
40
-        //
41
-    }
42
-
43
-    public function deleted($model)
44
-    {
45
-        //
46
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12
+
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17
+
18
+	public function creating($model)
19
+	{
20
+		//
21
+	}
22
+
23
+	public function created($model)
24
+	{
25
+		//
26
+	}
27
+
28
+	public function updating($model)
29
+	{
30
+		//
31
+	}
32
+
33
+	public function updated($model)
34
+	{
35
+		//
36
+	}
37
+
38
+	public function deleting($model)
39
+	{
40
+		//
41
+	}
42
+
43
+	public function deleted($model)
44
+	{
45
+		//
46
+	}
47 47
 
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Core/ModelObservers/SettingsObserver.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -5,61 +5,61 @@
 block discarded – undo
5 5
  */
6 6
 class SettingsObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12 12
 
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17 17
 
18
-    /**
19
-     * Prevent the creating of the settings.
20
-     * 
21
-     * @param  object $model the model beign created.
22
-     * @return void
23
-     */
24
-    public function creating($model)
25
-    {
26
-        $error = \ErrorHandler::cannotCreateSetting();
27
-        abort($error['status'], $error['message']);
28
-    }
18
+	/**
19
+	 * Prevent the creating of the settings.
20
+	 * 
21
+	 * @param  object $model the model beign created.
22
+	 * @return void
23
+	 */
24
+	public function creating($model)
25
+	{
26
+		$error = \ErrorHandler::cannotCreateSetting();
27
+		abort($error['status'], $error['message']);
28
+	}
29 29
 
30
-    public function created($model)
31
-    {
32
-        //
33
-    }
30
+	public function created($model)
31
+	{
32
+		//
33
+	}
34 34
 
35
-    /**
36
-     * Prevent updating of the setting key.
37
-     * 
38
-     * @param  object $model the model beign updated.
39
-     * @return void
40
-     */
41
-    public function updating($model)
42
-    {
43
-        if ($model->original['key'] !== $model->key) 
44
-        {
45
-            $error = \ErrorHandler::cannotUpdateSettingKey();
46
-            abort($error['status'], $error['message']);
47
-        }
48
-    }
35
+	/**
36
+	 * Prevent updating of the setting key.
37
+	 * 
38
+	 * @param  object $model the model beign updated.
39
+	 * @return void
40
+	 */
41
+	public function updating($model)
42
+	{
43
+		if ($model->original['key'] !== $model->key) 
44
+		{
45
+			$error = \ErrorHandler::cannotUpdateSettingKey();
46
+			abort($error['status'], $error['message']);
47
+		}
48
+	}
49 49
 
50
-    public function updated($model)
51
-    {
52
-        //
53
-    }
50
+	public function updated($model)
51
+	{
52
+		//
53
+	}
54 54
 
55
-    public function deleting($model)
56
-    {
57
-        //
58
-    }
55
+	public function deleting($model)
56
+	{
57
+		//
58
+	}
59 59
 
60
-    public function deleted($model)
61
-    {
62
-        //
63
-    }
60
+	public function deleted($model)
61
+	{
62
+		//
63
+	}
64 64
 
65 65
 }
66 66
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Core/ModelObservers/LogObserver.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -5,44 +5,44 @@
 block discarded – undo
5 5
  */
6 6
 class LogObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
12
-
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
17
-
18
-    public function creating($model)
19
-    {
20
-        //
21
-    }
22
-
23
-    public function created($model)
24
-    {
25
-        //
26
-    }
27
-
28
-    public function updating($model)
29
-    {
30
-        //
31
-    }
32
-
33
-    public function updated($model)
34
-    {
35
-        //
36
-    }
37
-
38
-    public function deleting($model)
39
-    {
40
-        //
41
-    }
42
-
43
-    public function deleted($model)
44
-    {
45
-        //
46
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12
+
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17
+
18
+	public function creating($model)
19
+	{
20
+		//
21
+	}
22
+
23
+	public function created($model)
24
+	{
25
+		//
26
+	}
27
+
28
+	public function updating($model)
29
+	{
30
+		//
31
+	}
32
+
33
+	public function updated($model)
34
+	{
35
+		//
36
+	}
37
+
38
+	public function deleting($model)
39
+	{
40
+		//
41
+	}
42
+
43
+	public function deleted($model)
44
+	{
45
+		//
46
+	}
47 47
 
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Core/Settings.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -5,31 +5,31 @@
 block discarded – undo
5 5
 
6 6
 class Settings extends Model{
7 7
 
8
-    use SoftDeletes;
9
-    protected $table    = 'settings';
10
-    protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
11
-    protected $hidden   = ['deleted_at'];
12
-    protected $guarded  = ['id', 'key'];
13
-    protected $fillable = ['name','value'];
8
+	use SoftDeletes;
9
+	protected $table    = 'settings';
10
+	protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
11
+	protected $hidden   = ['deleted_at'];
12
+	protected $guarded  = ['id', 'key'];
13
+	protected $fillable = ['name','value'];
14 14
     
15
-    public function getCreatedAtAttribute($value)
16
-    {
17
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
18
-    }
15
+	public function getCreatedAtAttribute($value)
16
+	{
17
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
18
+	}
19 19
 
20
-    public function getUpdatedAtAttribute($value)
21
-    {
22
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
23
-    }
20
+	public function getUpdatedAtAttribute($value)
21
+	{
22
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
23
+	}
24 24
 
25
-    public function getDeletedAtAttribute($value)
26
-    {
27
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
28
-    }
25
+	public function getDeletedAtAttribute($value)
26
+	{
27
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
28
+	}
29 29
 
30
-    public static function boot()
31
-    {
32
-        parent::boot();
33
-        parent::observe(\App::make('App\Modules\Core\ModelObservers\SettingsObserver'));
34
-    }
30
+	public static function boot()
31
+	{
32
+		parent::boot();
33
+		parent::observe(\App::make('App\Modules\Core\ModelObservers\SettingsObserver'));
34
+	}
35 35
 }
Please login to merge, or discard this patch.
src/Modules/Core/Log.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -5,41 +5,41 @@
 block discarded – undo
5 5
 
6 6
 class Log extends Model{
7 7
 
8
-    use SoftDeletes;
9
-    protected $table    = 'logs';
10
-    protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
11
-    protected $hidden   = ['deleted_at', 'item_type'];
12
-    protected $guarded  = ['id'];
13
-    protected $fillable = ['action', 'item_name', 'item_type', 'item_id', 'user_id'];
14
-
15
-    public function getCreatedAtAttribute($value)
16
-    {
17
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
18
-    }
19
-
20
-    public function getUpdatedAtAttribute($value)
21
-    {
22
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
23
-    }
24
-
25
-    public function getDeletedAtAttribute($value)
26
-    {
27
-        return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
28
-    }
8
+	use SoftDeletes;
9
+	protected $table    = 'logs';
10
+	protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
11
+	protected $hidden   = ['deleted_at', 'item_type'];
12
+	protected $guarded  = ['id'];
13
+	protected $fillable = ['action', 'item_name', 'item_type', 'item_id', 'user_id'];
14
+
15
+	public function getCreatedAtAttribute($value)
16
+	{
17
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
18
+	}
19
+
20
+	public function getUpdatedAtAttribute($value)
21
+	{
22
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
23
+	}
24
+
25
+	public function getDeletedAtAttribute($value)
26
+	{
27
+		return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString();
28
+	}
29 29
     
30
-    public function user()
31
-    {
32
-        return $this->belongsTo('App\Modules\Acl\AclUser');
33
-    }
34
-
35
-    public function item()
36
-    {
37
-        return $this->morphTo();
38
-    }
39
-
40
-    public static function boot()
41
-    {
42
-        parent::boot();
43
-        parent::observe(\App::make('App\Modules\Core\ModelObservers\LogObserver'));
44
-    }
30
+	public function user()
31
+	{
32
+		return $this->belongsTo('App\Modules\Acl\AclUser');
33
+	}
34
+
35
+	public function item()
36
+	{
37
+		return $this->morphTo();
38
+	}
39
+
40
+	public static function boot()
41
+	{
42
+		parent::boot();
43
+		parent::observe(\App::make('App\Modules\Core\ModelObservers\LogObserver'));
44
+	}
45 45
 }
Please login to merge, or discard this patch.
src/Modules/Acl/ModelObservers/AclUserObserver.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -5,51 +5,51 @@
 block discarded – undo
5 5
  */
6 6
 class AclUserObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
12
-
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
17
-
18
-    public function creating($model)
19
-    {
20
-        //
21
-    }
22
-
23
-    public function created($model)
24
-    {
25
-        //
26
-    }
27
-
28
-    public function updating($model)
29
-    {
30
-        //
31
-    }
32
-
33
-    public function updated($model)
34
-    {
35
-        //
36
-    }
37
-
38
-    /**
39
-     * Soft delete the associated groups and logs to the deleted user.
40
-     * 
41
-     * @param  object $model the delted model.
42
-     * @return void
43
-     */
44
-    public function deleting($model)
45
-    {
46
-        \DB::table('users_groups')->where('user_id', $model->id)->update(array('deleted_at' => \DB::raw('NOW()')));
47
-        $model->logs()->delete();
48
-    }
49
-
50
-    public function deleted($model)
51
-    {
52
-        //
53
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12
+
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17
+
18
+	public function creating($model)
19
+	{
20
+		//
21
+	}
22
+
23
+	public function created($model)
24
+	{
25
+		//
26
+	}
27
+
28
+	public function updating($model)
29
+	{
30
+		//
31
+	}
32
+
33
+	public function updated($model)
34
+	{
35
+		//
36
+	}
37
+
38
+	/**
39
+	 * Soft delete the associated groups and logs to the deleted user.
40
+	 * 
41
+	 * @param  object $model the delted model.
42
+	 * @return void
43
+	 */
44
+	public function deleting($model)
45
+	{
46
+		\DB::table('users_groups')->where('user_id', $model->id)->update(array('deleted_at' => \DB::raw('NOW()')));
47
+		$model->logs()->delete();
48
+	}
49
+
50
+	public function deleted($model)
51
+	{
52
+		//
53
+	}
54 54
 
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Acl/ModelObservers/AclGroupObserver.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -5,50 +5,50 @@
 block discarded – undo
5 5
  */
6 6
 class AclGroupObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
12
-
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
17
-
18
-    public function creating($model)
19
-    {
20
-        //
21
-    }
22
-
23
-    public function created($model)
24
-    {
25
-        //
26
-    }
27
-
28
-    public function updating($model)
29
-    {
30
-        //
31
-    }
32
-
33
-    public function updated($model)
34
-    {
35
-        //
36
-    }
37
-
38
-    /**
39
-     * Soft delete the associated permissions to the deleted group.
40
-     * 
41
-     * @param  object $model the delted model.
42
-     * @return void
43
-     */
44
-    public function deleting($model)
45
-    {
46
-        \DB::table('groups_permissions')->where('group_id', $model->id)->update(array('deleted_at' => \DB::raw('NOW()')));
47
-    }
48
-
49
-    public function deleted($model)
50
-    {
51
-        //
52
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12
+
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17
+
18
+	public function creating($model)
19
+	{
20
+		//
21
+	}
22
+
23
+	public function created($model)
24
+	{
25
+		//
26
+	}
27
+
28
+	public function updating($model)
29
+	{
30
+		//
31
+	}
32
+
33
+	public function updated($model)
34
+	{
35
+		//
36
+	}
37
+
38
+	/**
39
+	 * Soft delete the associated permissions to the deleted group.
40
+	 * 
41
+	 * @param  object $model the delted model.
42
+	 * @return void
43
+	 */
44
+	public function deleting($model)
45
+	{
46
+		\DB::table('groups_permissions')->where('group_id', $model->id)->update(array('deleted_at' => \DB::raw('NOW()')));
47
+	}
48
+
49
+	public function deleted($model)
50
+	{
51
+		//
52
+	}
53 53
 
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.