@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
5 | 5 | |
6 | -class Notification extends Model{ |
|
6 | +class Notification extends Model { |
|
7 | 7 | |
8 | 8 | use SoftDeletes; |
9 | 9 | protected $table = 'notifications'; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | public function getDescriptionAttribute() |
43 | 43 | { |
44 | - return trans('notifications.' . $this->attributes['key'], unserialize($this->attributes['data'])); |
|
44 | + return trans('notifications.'.$this->attributes['key'], unserialize($this->attributes['data'])); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public static function boot() |
@@ -23,7 +23,7 @@ |
||
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); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use SoftDeletes; |
10 | 10 | protected $table = 'users'; |
11 | 11 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
12 | - protected $hidden = ['password', 'remember_token','deleted_at']; |
|
12 | + protected $hidden = ['password', 'remember_token', 'deleted_at']; |
|
13 | 13 | protected $guarded = ['id']; |
14 | 14 | protected $fillable = ['name', 'email', 'password']; |
15 | 15 | public $searchable = ['name', 'email']; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | public function groups() |
49 | 49 | { |
50 | - return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
50 | + return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup', 'users_groups', 'user_id', 'group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public static function boot() |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $user = \Core::users()->find(\JWTAuth::parseToken()->authenticate()->id, $relations); |
27 | 27 | foreach ($user->groups()->get() as $group) |
28 | 28 | { |
29 | - $group->permissions->each(function ($permission) use (&$permissions){ |
|
29 | + $group->permissions->each(function($permission) use (&$permissions){ |
|
30 | 30 | $permissions[$permission->model][$permission->id] = $permission->name; |
31 | 31 | }); |
32 | 32 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param boolean $user |
45 | 45 | * @return boolean |
46 | 46 | */ |
47 | - public function can($nameOfPermission, $model, $user = false ) |
|
47 | + public function can($nameOfPermission, $model, $user = false) |
|
48 | 48 | { |
49 | 49 | $user = $user ?: \JWTAuth::parseToken()->authenticate(); |
50 | 50 | $permissions = []; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | \ErrorHandler::tokenExpired(); |
55 | 55 | } |
56 | 56 | |
57 | - $user->groups->pluck('permissions')->each(function ($permission) use (&$permissions, $model){ |
|
57 | + $user->groups->pluck('permissions')->each(function($permission) use (&$permissions, $model){ |
|
58 | 58 | $permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray()); |
59 | 59 | }); |
60 | 60 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function assignGroups($user_id, $group_ids) |
84 | 84 | { |
85 | - \DB::transaction(function () use ($user_id, $group_ids) { |
|
85 | + \DB::transaction(function() use ($user_id, $group_ids) { |
|
86 | 86 | $user = $this->find($user_id); |
87 | 87 | $user->groups()->detach(); |
88 | 88 | $user->groups()->attach($group_ids); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $view->with(['url' => $url]); |
243 | 243 | }); |
244 | 244 | |
245 | - $response = \Password::sendResetLink($email, function (\Illuminate\Mail\Message $message) { |
|
245 | + $response = \Password::sendResetLink($email, function(\Illuminate\Mail\Message $message) { |
|
246 | 246 | $message->subject('Your Password Reset Link'); |
247 | 247 | }); |
248 | 248 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | public function resetPassword($credentials) |
263 | 263 | { |
264 | 264 | $token = false; |
265 | - $response = \Password::reset($credentials, function ($user, $password) use (&$token) { |
|
265 | + $response = \Password::reset($credentials, function($user, $password) use (&$token) { |
|
266 | 266 | $user->password = bcrypt($password); |
267 | 267 | $user->save(); |
268 | 268 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('users', function (Blueprint $table) { |
|
15 | + Schema::create('users', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('name', 100)->default(''); |
18 | 18 | $table->string('email')->unique(); |
@@ -101,7 +101,7 @@ |
||
101 | 101 | */ |
102 | 102 | public function down() |
103 | 103 | { |
104 | - $permissions = DB::table('permissions')->whereIn('model', ['reports']); |
|
104 | + $permissions = DB::table('permissions')->whereIn('model', ['reports']); |
|
105 | 105 | DB::table('groups_permissions')->whereIn('permission_id', $permissions->lists('id'))->delete(); |
106 | 106 | $permissions->delete(); |
107 | 107 | } |