Completed
Push — master ( 8df45b...9d0042 )
by Sherif
02:28 queued 11s
created
Modules/PushNotificationDevices/Http/Resources/PushNotificationDevice.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@
 block discarded – undo
7 7
 
8 8
 class PushNotificationDevice 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
-            'device_token' => $this->device_token,
25
-            'access_token' => $this->access_token,
26
-            'user' => new UserResource($this->whenLoaded('user')),
27
-            'created_at' => $this->created_at,
28
-            'updated_at' => $this->updated_at,
29
-        ];
30
-    }
22
+		return [
23
+			'id' => $this->id,
24
+			'device_token' => $this->device_token,
25
+			'access_token' => $this->access_token,
26
+			'user' => new UserResource($this->whenLoaded('user')),
27
+			'created_at' => $this->created_at,
28
+			'updated_at' => $this->updated_at,
29
+		];
30
+	}
31 31
 }
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.
Http/Controllers/PushNotificationDeviceController.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -11,55 +11,55 @@
 block discarded – undo
11 11
 
12 12
 class PushNotificationDeviceController extends BaseApiController
13 13
 {
14
-    /**
15
-     * List of all route actions that the base api controller
16
-     * will skip permissions check for them.
17
-     * @var array
18
-     */
19
-    protected $skipPermissionCheck = ['registerDevice'];
14
+	/**
15
+	 * List of all route actions that the base api controller
16
+	 * will skip permissions check for them.
17
+	 * @var array
18
+	 */
19
+	protected $skipPermissionCheck = ['registerDevice'];
20 20
 
21
-    /**
22
-     * Init new object.
23
-     *
24
-     * @param   PushNotificationDeviceRepository $repo
25
-     * @param   CoreConfig                       $config
26
-     * @return  void
27
-     */
28
-    public function __construct(PushNotificationDeviceRepository $repo, CoreConfig $config)
29
-    {
30
-        parent::__construct($repo, $config, 'App\Modules\PushNotificationDevices\Http\Resources\PushNotificationDevice');
31
-    }
21
+	/**
22
+	 * Init new object.
23
+	 *
24
+	 * @param   PushNotificationDeviceRepository $repo
25
+	 * @param   CoreConfig                       $config
26
+	 * @return  void
27
+	 */
28
+	public function __construct(PushNotificationDeviceRepository $repo, CoreConfig $config)
29
+	{
30
+		parent::__construct($repo, $config, 'App\Modules\PushNotificationDevices\Http\Resources\PushNotificationDevice');
31
+	}
32 32
 
33
-    /**
34
-     * Insert the given model to storage.
35
-     *
36
-     * @param InsertPushNotificationDevice $request
37
-     * @return \Illuminate\Http\Response
38
-     */
39
-    public function insert(InsertPushNotificationDevice $request)
40
-    {
41
-        return new $this->modelResource($this->repo->save($request->all()));
42
-    }
33
+	/**
34
+	 * Insert the given model to storage.
35
+	 *
36
+	 * @param InsertPushNotificationDevice $request
37
+	 * @return \Illuminate\Http\Response
38
+	 */
39
+	public function insert(InsertPushNotificationDevice $request)
40
+	{
41
+		return new $this->modelResource($this->repo->save($request->all()));
42
+	}
43 43
 
44
-    /**
45
-     * Update the given model to storage.
46
-     *
47
-     * @param UpdatePushNotificationDevice $request
48
-     * @return \Illuminate\Http\Response
49
-     */
50
-    public function update(UpdatePushNotificationDevice $request)
51
-    {
52
-        return new $this->modelResource($this->repo->save($request->all()));
53
-    }
44
+	/**
45
+	 * Update the given model to storage.
46
+	 *
47
+	 * @param UpdatePushNotificationDevice $request
48
+	 * @return \Illuminate\Http\Response
49
+	 */
50
+	public function update(UpdatePushNotificationDevice $request)
51
+	{
52
+		return new $this->modelResource($this->repo->save($request->all()));
53
+	}
54 54
 
55
-    /**
56
-     * Register the given device to the logged in user.
57
-     *
58
-     * @param RegisterDevice $request
59
-     * @return \Illuminate\Http\Response
60
-     */
61
-    public function registerDevice(RegisterDevice $request)
62
-    {
63
-        return new $this->modelResource($this->repo->registerDevice($request->all()));
64
-    }
55
+	/**
56
+	 * Register the given device to the logged in user.
57
+	 *
58
+	 * @param RegisterDevice $request
59
+	 * @return \Illuminate\Http\Response
60
+	 */
61
+	public function registerDevice(RegisterDevice $request)
62
+	{
63
+		return new $this->modelResource($this->repo->registerDevice($request->all()));
64
+	}
65 65
 }
Please login to merge, or discard this patch.
PushNotificationDevices/Http/Requests/InsertPushNotificationDevice copy.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 InsertPushNotificationDevice 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
-            'device_token' => 'required|string|max:255',
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
+			'device_token' => 'required|string|max:255',
28
+			'user_id'      => 'required|exists:users,id'
29
+		];
30
+	}
31 31
 }
Please login to merge, or discard this patch.
PushNotificationDevices/Http/Requests/UpdatePushNotificationDevice.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 block discarded – undo
6 6
 
7 7
 class UpdatePushNotificationDevice 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:push_notification_devices,id',
28
-            'device_token' => 'required|string|max:255',
29
-            'user_id'      => 'required|exists:users,id'
30
-        ];
31
-    }
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:push_notification_devices,id',
28
+			'device_token' => 'required|string|max:255',
29
+			'user_id'      => 'required|exists:users,id'
30
+		];
31
+	}
32 32
 }
Please login to merge, or discard this patch.
src/Modules/PushNotificationDevices/Http/Requests/RegisterDevice.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 RegisterDevice 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
-            'device_token' => 'required|string|max:255'
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
+			'device_token' => 'required|string|max:255'
28
+		];
29
+	}
30 30
 }
Please login to merge, or discard this patch.
src/Modules/PushNotificationDevices/PushNotificationDevice.php 1 patch
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -6,48 +6,48 @@
 block discarded – undo
6 6
 class PushNotificationDevice extends Model
7 7
 {
8 8
 
9
-    use SoftDeletes;
10
-    protected $table    = 'push_notifications_devices';
11
-    protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
12
-    protected $hidden   = ['deleted_at', 'access_token'];
13
-    protected $guarded  = ['id'];
14
-    protected $fillable = ['device_token', 'user_id', 'access_token'];
15
-    public $searchable  = ['device_token'];
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
-    }
9
+	use SoftDeletes;
10
+	protected $table    = 'push_notifications_devices';
11
+	protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
12
+	protected $hidden   = ['deleted_at', 'access_token'];
13
+	protected $guarded  = ['id'];
14
+	protected $fillable = ['device_token', 'user_id', 'access_token'];
15
+	public $searchable  = ['device_token'];
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 31
     
32
-    public function user()
33
-    {
34
-        return $this->belongsTo('App\Modules\Users\AclUser');
35
-    }
36
-
37
-    /**
38
-     * Encrypt the access_token attribute before
39
-     * saving it in the storage.
40
-     *
41
-     * @param string $value
42
-     */
43
-    public function setLoginTokenAttribute($value)
44
-    {
45
-        $this->attributes['access_token'] = encrypt($value);
46
-    }
47
-
48
-    public static function boot()
49
-    {
50
-        parent::boot();
51
-        PushNotificationDevice::observe(\App::make('App\Modules\PushNotificationDevices\ModelObservers\PushNotificationDeviceObserver'));
52
-    }
32
+	public function user()
33
+	{
34
+		return $this->belongsTo('App\Modules\Users\AclUser');
35
+	}
36
+
37
+	/**
38
+	 * Encrypt the access_token attribute before
39
+	 * saving it in the storage.
40
+	 *
41
+	 * @param string $value
42
+	 */
43
+	public function setLoginTokenAttribute($value)
44
+	{
45
+		$this->attributes['access_token'] = encrypt($value);
46
+	}
47
+
48
+	public static function boot()
49
+	{
50
+		parent::boot();
51
+		PushNotificationDevice::observe(\App::make('App\Modules\PushNotificationDevices\ModelObservers\PushNotificationDeviceObserver'));
52
+	}
53 53
 }
Please login to merge, or discard this patch.
src/Modules/Permissions/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\Groups\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\Groups\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\Permissions\ModelObservers\AclPermissionObserver'));
41
-    }
37
+	public static function boot()
38
+	{
39
+		parent::boot();
40
+		AclPermission::observe(\App::make('App\Modules\Permissions\ModelObservers\AclPermissionObserver'));
41
+	}
42 42
 }
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   AclPermission $model
12
-     * @return  void
13
-     */
14
-    public function __construct(AclPermission $model)
15
-    {
16
-        parent::__construct($model);
17
-    }
8
+	/**
9
+	 * Init new object.
10
+	 *
11
+	 * @param   AclPermission $model
12
+	 * @return  void
13
+	 */
14
+	public function __construct(AclPermission $model)
15
+	{
16
+		parent::__construct($model);
17
+	}
18 18
 }
Please login to merge, or discard this patch.
src/Modules/Permissions/ModelObservers/AclPermissionObserver.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 AclPermissionObserver
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.