Completed
Push — master ( 9ecb5e...97e3cb )
by Sherif
13:30
created
src/Modules/V1/Acl/Repositories/UserRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $user        = \Core::users()->find(\Auth::id(), $relations);
49 49
         foreach ($user->groups()->get() as $group)
50 50
         {
51
-            $group->permissions->each(function ($permission) use (&$permissions){
51
+            $group->permissions->each(function($permission) use (&$permissions){
52 52
                 $permissions[$permission->model][$permission->id] = $permission->name;
53 53
             });
54 54
         }
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
      * @param  boolean $user
67 67
      * @return boolean
68 68
      */
69
-    public function can($nameOfPermission, $model, $user = false )
69
+    public function can($nameOfPermission, $model, $user = false)
70 70
     {      
71 71
         $user        = $user = $this->find(\Auth::id(), ['groups.permissions']);
72 72
         $permissions = [];
73 73
 
74
-        $user->groups->pluck('permissions')->each(function ($permission) use (&$permissions, $model){
74
+        $user->groups->pluck('permissions')->each(function($permission) use (&$permissions, $model){
75 75
             $permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray()); 
76 76
         });
77 77
         
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function assignGroups($user_id, $group_ids)
103 103
     {
104
-        \DB::transaction(function () use ($user_id, $group_ids) {
104
+        \DB::transaction(function() use ($user_id, $group_ids) {
105 105
             $user = $this->find($user_id);
106 106
             $user->groups()->detach();
107 107
             $user->groups()->attach($group_ids);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         $url   = $this->config['resetLink'];
251 251
         $token = \Password::getRepository()->create($user);
252 252
         
253
-        \Mail::send('acl::resetpassword', ['user' => $user, 'url' => $url, 'token' => $token], function ($m) use ($user) {
253
+        \Mail::send('acl::resetpassword', ['user' => $user, 'url' => $url, 'token' => $token], function($m) use ($user) {
254 254
             $m->to($user->email, $user->name)->subject('Your Password Reset Link');
255 255
         });
256 256
     }
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      */
264 264
     public function resetPassword($credentials)
265 265
     {
266
-        $response = \Password::reset($credentials, function ($user, $password) {
266
+        $response = \Password::reset($credentials, function($user, $password) {
267 267
             $user->password = $password;
268 268
             $user->save();
269 269
         });
Please login to merge, or discard this patch.
src/Modules/V1/Acl/AclUser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     use SoftDeletes, HasApiTokens;
11 11
     protected $table    = 'users';
12 12
     protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
13
-    protected $hidden   = ['password', 'remember_token','deleted_at'];
13
+    protected $hidden   = ['password', 'remember_token', 'deleted_at'];
14 14
     protected $guarded  = ['id'];
15 15
     protected $fillable = ['name', 'email', 'password'];
16 16
     public $searchable  = ['name', 'email'];
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     public function groups()
45 45
     {
46
-        return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps();
46
+        return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup', 'users_groups', 'user_id', 'group_id')->whereNull('users_groups.deleted_at')->withTimestamps();
47 47
     }
48 48
 
49 49
     /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function receivesBroadcastNotificationsOn()
86 86
     {
87
-        return 'users.' . $this->id;
87
+        return 'users.'.$this->id;
88 88
     }
89 89
     
90 90
     public static function boot()
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Seeds/AssignRelationsSeeder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     public function run()
15 15
     {
16 16
     	$adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
17
-		$adminUserId  = \DB::table('users')->where('email', '[email protected]')->select('id')->first()->id;
17
+		$adminUserId = \DB::table('users')->where('email', '[email protected]')->select('id')->first()->id;
18 18
 
19 19
 		/**
20 20
 		 * Assign users to groups.
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         /**
32 32
 		 * Assign the permissions to the admin group.
33 33
 		 */
34
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['users', 'permissions', 'groups', 'oauthClients'])->each(function ($permission) use ($adminGroupId) {
34
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['users', 'permissions', 'groups', 'oauthClients'])->each(function($permission) use ($adminGroupId) {
35 35
         	\DB::table('groups_permissions')->insert(
36 36
 				[
37 37
 				'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Factories/OauthClientFactory.php 1 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\V1\Acl\OauthClient::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\V1\Acl\OauthClient::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
     	'user_id'                => $faker->randomDigit(),
6 6
 		'name'                   => $faker->name(),
Please login to merge, or discard this patch.
Database/Migrations/2016_06_01_000002_create_oauth_access_tokens_table.php 1 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_access_tokens', function (Blueprint $table) {
16
+        Schema::create('oauth_access_tokens', function(Blueprint $table) {
17 17
             $table->string('id', 100)->primary();
18 18
             $table->integer('user_id')->index()->nullable();
19 19
             $table->integer('client_id');
Please login to merge, or discard this patch.
Migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php 1 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_personal_access_clients', function (Blueprint $table) {
16
+        Schema::create('oauth_personal_access_clients', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('client_id')->index();
19 19
             $table->timestamps();
Please login to merge, or discard this patch.
Database/Migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php 1 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)->index();
19 19
             $table->boolean('revoked');
Please login to merge, or discard this patch.
V1/Acl/Database/Migrations/2016_06_01_000004_create_oauth_clients_table.php 1 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_clients', function (Blueprint $table) {
16
+        Schema::create('oauth_clients', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('user_id')->index()->nullable();
19 19
             $table->string('name');
Please login to merge, or discard this patch.
Acl/Database/Migrations/2016_06_01_000001_create_oauth_auth_codes_table.php 1 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->integer('user_id');
19 19
             $table->integer('client_id');
Please login to merge, or discard this patch.