@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $factory->define(App\Modules\Acl\AclUser::class, function (Faker\Generator $faker) { |
4 | - return [ |
|
5 | - 'profile_picture' => 'http://lorempixel.com/400/200/', |
|
6 | - 'name' => $faker->name(), |
|
7 | - 'email' => $faker->safeEmail(), |
|
8 | - 'password' => 123456, |
|
9 | - 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
|
10 | - 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
|
11 | - ]; |
|
4 | + return [ |
|
5 | + 'profile_picture' => 'http://lorempixel.com/400/200/', |
|
6 | + 'name' => $faker->name(), |
|
7 | + 'email' => $faker->safeEmail(), |
|
8 | + 'password' => 123456, |
|
9 | + 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
|
10 | + 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
|
11 | + ]; |
|
12 | 12 | }); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$factory->define(App\Modules\Acl\AclUser::class, function (Faker\Generator $faker) { |
|
3 | +$factory->define(App\Modules\Acl\AclUser::class, function(Faker\Generator $faker) { |
|
4 | 4 | return [ |
5 | 5 | 'profile_picture' => 'http://lorempixel.com/400/200/', |
6 | 6 | 'name' => $faker->name(), |
@@ -5,66 +5,66 @@ |
||
5 | 5 | |
6 | 6 | class Groups extends Migration |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('groups', function (Blueprint $table) { |
|
16 | - $table->increments('id'); |
|
17 | - $table->string('name', 100)->unique(); |
|
18 | - $table->softDeletes(); |
|
19 | - $table->timestamps(); |
|
20 | - }); |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('groups', function (Blueprint $table) { |
|
16 | + $table->increments('id'); |
|
17 | + $table->string('name', 100)->unique(); |
|
18 | + $table->softDeletes(); |
|
19 | + $table->timestamps(); |
|
20 | + }); |
|
21 | 21 | |
22 | - Schema::create('users_groups', function (Blueprint $table) { |
|
23 | - $table->increments('id'); |
|
24 | - $table->integer('user_id'); |
|
25 | - $table->integer('group_id'); |
|
26 | - $table->softDeletes(); |
|
27 | - $table->timestamps(); |
|
22 | + Schema::create('users_groups', function (Blueprint $table) { |
|
23 | + $table->increments('id'); |
|
24 | + $table->integer('user_id'); |
|
25 | + $table->integer('group_id'); |
|
26 | + $table->softDeletes(); |
|
27 | + $table->timestamps(); |
|
28 | 28 | |
29 | - $table->index(['user_id']); |
|
30 | - }); |
|
29 | + $table->index(['user_id']); |
|
30 | + }); |
|
31 | 31 | |
32 | - /** |
|
33 | - * Create Default groups. |
|
34 | - */ |
|
35 | - \DB::table('groups')->insert( |
|
36 | - [ |
|
37 | - [ |
|
38 | - 'name' => 'Admin', |
|
39 | - 'created_at' => \DB::raw('NOW()'), |
|
40 | - 'updated_at' => \DB::raw('NOW()') |
|
41 | - ] |
|
42 | - ] |
|
43 | - ); |
|
32 | + /** |
|
33 | + * Create Default groups. |
|
34 | + */ |
|
35 | + \DB::table('groups')->insert( |
|
36 | + [ |
|
37 | + [ |
|
38 | + 'name' => 'Admin', |
|
39 | + 'created_at' => \DB::raw('NOW()'), |
|
40 | + 'updated_at' => \DB::raw('NOW()') |
|
41 | + ] |
|
42 | + ] |
|
43 | + ); |
|
44 | 44 | |
45 | - /** |
|
46 | - * Assign default users to admin groups. |
|
47 | - */ |
|
48 | - $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
49 | - $adminUserId = \DB::table('users')->where('email', '[email protected]')->select('id')->first()->id; |
|
50 | - \DB::table('users_groups')->insert( |
|
51 | - [ |
|
52 | - 'user_id' => $adminUserId, |
|
53 | - 'group_id' => $adminGroupId, |
|
54 | - 'created_at' => \DB::raw('NOW()'), |
|
55 | - 'updated_at' => \DB::raw('NOW()') |
|
56 | - ] |
|
57 | - ); |
|
58 | - } |
|
45 | + /** |
|
46 | + * Assign default users to admin groups. |
|
47 | + */ |
|
48 | + $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
49 | + $adminUserId = \DB::table('users')->where('email', '[email protected]')->select('id')->first()->id; |
|
50 | + \DB::table('users_groups')->insert( |
|
51 | + [ |
|
52 | + 'user_id' => $adminUserId, |
|
53 | + 'group_id' => $adminGroupId, |
|
54 | + 'created_at' => \DB::raw('NOW()'), |
|
55 | + 'updated_at' => \DB::raw('NOW()') |
|
56 | + ] |
|
57 | + ); |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * Reverse the migrations. |
|
62 | - * |
|
63 | - * @return void |
|
64 | - */ |
|
65 | - public function down() |
|
66 | - { |
|
67 | - Schema::dropIfExists('groups'); |
|
68 | - Schema::dropIfExists('users_groups'); |
|
69 | - } |
|
60 | + /** |
|
61 | + * Reverse the migrations. |
|
62 | + * |
|
63 | + * @return void |
|
64 | + */ |
|
65 | + public function down() |
|
66 | + { |
|
67 | + Schema::dropIfExists('groups'); |
|
68 | + Schema::dropIfExists('users_groups'); |
|
69 | + } |
|
70 | 70 | } |
@@ -12,14 +12,14 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('groups', function (Blueprint $table) { |
|
15 | + Schema::create('groups', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('name', 100)->unique(); |
18 | 18 | $table->softDeletes(); |
19 | 19 | $table->timestamps(); |
20 | 20 | }); |
21 | 21 | |
22 | - Schema::create('users_groups', function (Blueprint $table) { |
|
22 | + Schema::create('users_groups', function(Blueprint $table) { |
|
23 | 23 | $table->increments('id'); |
24 | 24 | $table->integer('user_id'); |
25 | 25 | $table->integer('group_id'); |
@@ -5,40 +5,40 @@ |
||
5 | 5 | |
6 | 6 | class Permissions extends Migration |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('permissions', function (Blueprint $table) { |
|
16 | - $table->increments('id'); |
|
17 | - $table->string('name', 100); |
|
18 | - $table->string('model', 100); |
|
19 | - $table->softDeletes(); |
|
20 | - $table->timestamps(); |
|
21 | - $table->unique(array('name', 'model')); |
|
22 | - }); |
|
23 | - Schema::create('groups_permissions', function (Blueprint $table) { |
|
24 | - $table->increments('id'); |
|
25 | - $table->integer('group_id'); |
|
26 | - $table->integer('permission_id'); |
|
27 | - $table->softDeletes(); |
|
28 | - $table->timestamps(); |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('permissions', function (Blueprint $table) { |
|
16 | + $table->increments('id'); |
|
17 | + $table->string('name', 100); |
|
18 | + $table->string('model', 100); |
|
19 | + $table->softDeletes(); |
|
20 | + $table->timestamps(); |
|
21 | + $table->unique(array('name', 'model')); |
|
22 | + }); |
|
23 | + Schema::create('groups_permissions', function (Blueprint $table) { |
|
24 | + $table->increments('id'); |
|
25 | + $table->integer('group_id'); |
|
26 | + $table->integer('permission_id'); |
|
27 | + $table->softDeletes(); |
|
28 | + $table->timestamps(); |
|
29 | 29 | |
30 | - $table->index(['group_id']); |
|
31 | - }); |
|
32 | - } |
|
30 | + $table->index(['group_id']); |
|
31 | + }); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Reverse the migrations. |
|
36 | - * |
|
37 | - * @return void |
|
38 | - */ |
|
39 | - public function down() |
|
40 | - { |
|
41 | - Schema::dropIfExists('permissions'); |
|
42 | - Schema::dropIfExists('groups_permissions'); |
|
43 | - } |
|
34 | + /** |
|
35 | + * Reverse the migrations. |
|
36 | + * |
|
37 | + * @return void |
|
38 | + */ |
|
39 | + public function down() |
|
40 | + { |
|
41 | + Schema::dropIfExists('permissions'); |
|
42 | + Schema::dropIfExists('groups_permissions'); |
|
43 | + } |
|
44 | 44 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('permissions', function (Blueprint $table) { |
|
15 | + Schema::create('permissions', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('name', 100); |
18 | 18 | $table->string('model', 100); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $table->timestamps(); |
21 | 21 | $table->unique(array('name', 'model')); |
22 | 22 | }); |
23 | - Schema::create('groups_permissions', function (Blueprint $table) { |
|
23 | + Schema::create('groups_permissions', function(Blueprint $table) { |
|
24 | 24 | $table->increments('id'); |
25 | 25 | $table->integer('group_id'); |
26 | 26 | $table->integer('permission_id'); |
@@ -5,51 +5,51 @@ |
||
5 | 5 | |
6 | 6 | class Users extends Migration |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('users', function (Blueprint $table) { |
|
16 | - $table->increments('id'); |
|
17 | - $table->string('profile_picture', 150)->nullable(); |
|
18 | - $table->string('name', 100)->nullable(); |
|
19 | - $table->string('email')->unique(); |
|
20 | - $table->string('password', 60)->nullable(); |
|
21 | - $table->boolean('blocked')->default(0); |
|
22 | - $table->boolean('confirmed')->default(0); |
|
23 | - $table->string('confirmation_code')->nullable(); |
|
24 | - $table->string('locale', 2)->default('en'); |
|
25 | - $table->string('timezone', 50)->default('Africa/Cairo'); |
|
26 | - $table->softDeletes(); |
|
27 | - $table->rememberToken(); |
|
28 | - $table->timestamps(); |
|
29 | - }); |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('users', function (Blueprint $table) { |
|
16 | + $table->increments('id'); |
|
17 | + $table->string('profile_picture', 150)->nullable(); |
|
18 | + $table->string('name', 100)->nullable(); |
|
19 | + $table->string('email')->unique(); |
|
20 | + $table->string('password', 60)->nullable(); |
|
21 | + $table->boolean('blocked')->default(0); |
|
22 | + $table->boolean('confirmed')->default(0); |
|
23 | + $table->string('confirmation_code')->nullable(); |
|
24 | + $table->string('locale', 2)->default('en'); |
|
25 | + $table->string('timezone', 50)->default('Africa/Cairo'); |
|
26 | + $table->softDeletes(); |
|
27 | + $table->rememberToken(); |
|
28 | + $table->timestamps(); |
|
29 | + }); |
|
30 | 30 | |
31 | - /** |
|
32 | - * Create Default users. |
|
33 | - */ |
|
34 | - \DB::table('users')->insertGetId( |
|
35 | - [ |
|
36 | - 'name' => 'Admin', |
|
37 | - 'email' => '[email protected]', |
|
38 | - 'password' => bcrypt('123456'), |
|
39 | - 'confirmed' => 1, |
|
40 | - 'created_at' => \DB::raw('NOW()'), |
|
41 | - 'updated_at' => \DB::raw('NOW()') |
|
42 | - ] |
|
43 | - ); |
|
44 | - } |
|
31 | + /** |
|
32 | + * Create Default users. |
|
33 | + */ |
|
34 | + \DB::table('users')->insertGetId( |
|
35 | + [ |
|
36 | + 'name' => 'Admin', |
|
37 | + 'email' => '[email protected]', |
|
38 | + 'password' => bcrypt('123456'), |
|
39 | + 'confirmed' => 1, |
|
40 | + 'created_at' => \DB::raw('NOW()'), |
|
41 | + 'updated_at' => \DB::raw('NOW()') |
|
42 | + ] |
|
43 | + ); |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Reverse the migrations. |
|
48 | - * |
|
49 | - * @return void |
|
50 | - */ |
|
51 | - public function down() |
|
52 | - { |
|
53 | - Schema::dropIfExists('users'); |
|
54 | - } |
|
46 | + /** |
|
47 | + * Reverse the migrations. |
|
48 | + * |
|
49 | + * @return void |
|
50 | + */ |
|
51 | + public function down() |
|
52 | + { |
|
53 | + Schema::dropIfExists('users'); |
|
54 | + } |
|
55 | 55 | } |
@@ -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('profile_picture', 150)->nullable(); |
18 | 18 | $table->string('name', 100)->nullable(); |
@@ -6,18 +6,18 @@ |
||
6 | 6 | |
7 | 7 | class AclDatabaseSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - $this->call(ClearDataSeeder::class); |
|
17 | - $this->call(UsersTableSeeder::class); |
|
18 | - $this->call(GroupsTableSeeder::class); |
|
19 | - $this->call(PermissionsTableSeeder::class); |
|
20 | - $this->call(OauthClientsTableSeeder::class); |
|
21 | - $this->call(AssignRelationsSeeder::class); |
|
22 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + $this->call(ClearDataSeeder::class); |
|
17 | + $this->call(UsersTableSeeder::class); |
|
18 | + $this->call(GroupsTableSeeder::class); |
|
19 | + $this->call(PermissionsTableSeeder::class); |
|
20 | + $this->call(OauthClientsTableSeeder::class); |
|
21 | + $this->call(AssignRelationsSeeder::class); |
|
22 | + } |
|
23 | 23 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | $response = \ApiConsumer::post('/oauth/token', $data); |
53 | 53 | |
54 | - if (! $response->isSuccessful()) { |
|
54 | + if ( ! $response->isSuccessful()) { |
|
55 | 55 | if ($grantType == 'refresh_token') { |
56 | 56 | \ErrorHandler::invalidRefreshToken(); |
57 | 57 | } |
@@ -2,77 +2,77 @@ |
||
2 | 2 | |
3 | 3 | class LoginProxy |
4 | 4 | { |
5 | - /** |
|
6 | - * Attempt to create an access token using user credentials. |
|
7 | - * |
|
8 | - * @param array $credentials |
|
9 | - * @param boolean $adminLogin |
|
10 | - * @return array |
|
11 | - */ |
|
12 | - public function login($credentials, $adminLogin = false) |
|
13 | - { |
|
14 | - $user = \Core::users()->login($credentials, $adminLogin); |
|
15 | - $tokens = $this->proxy('password', [ |
|
16 | - 'username' => $credentials['email'], |
|
17 | - 'password' => $credentials['password'] |
|
18 | - ]); |
|
5 | + /** |
|
6 | + * Attempt to create an access token using user credentials. |
|
7 | + * |
|
8 | + * @param array $credentials |
|
9 | + * @param boolean $adminLogin |
|
10 | + * @return array |
|
11 | + */ |
|
12 | + public function login($credentials, $adminLogin = false) |
|
13 | + { |
|
14 | + $user = \Core::users()->login($credentials, $adminLogin); |
|
15 | + $tokens = $this->proxy('password', [ |
|
16 | + 'username' => $credentials['email'], |
|
17 | + 'password' => $credentials['password'] |
|
18 | + ]); |
|
19 | 19 | |
20 | - return compact('user', 'tokens'); |
|
21 | - } |
|
20 | + return compact('user', 'tokens'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Attempt to refresh the access token useing the given refresh token. |
|
25 | - * |
|
26 | - * @param string $refreshToken |
|
27 | - * @return array |
|
28 | - */ |
|
29 | - public function refreshToken($refreshToken) |
|
30 | - { |
|
31 | - return $this->proxy('refresh_token', [ |
|
32 | - 'refresh_token' => $refreshToken |
|
33 | - ]); |
|
34 | - } |
|
23 | + /** |
|
24 | + * Attempt to refresh the access token useing the given refresh token. |
|
25 | + * |
|
26 | + * @param string $refreshToken |
|
27 | + * @return array |
|
28 | + */ |
|
29 | + public function refreshToken($refreshToken) |
|
30 | + { |
|
31 | + return $this->proxy('refresh_token', [ |
|
32 | + 'refresh_token' => $refreshToken |
|
33 | + ]); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Proxy a request to the OAuth server. |
|
38 | - * |
|
39 | - * @param string $grantType what type of grant type should be proxied |
|
40 | - * @param array |
|
41 | - */ |
|
42 | - public function proxy($grantType, array $data = []) |
|
43 | - { |
|
44 | - $data = array_merge($data, [ |
|
45 | - 'client_id' => config('skeleton.passport_client_id'), |
|
46 | - 'client_secret' => config('skeleton.passport_client_secret'), |
|
47 | - 'grant_type' => $grantType |
|
48 | - ]); |
|
36 | + /** |
|
37 | + * Proxy a request to the OAuth server. |
|
38 | + * |
|
39 | + * @param string $grantType what type of grant type should be proxied |
|
40 | + * @param array |
|
41 | + */ |
|
42 | + public function proxy($grantType, array $data = []) |
|
43 | + { |
|
44 | + $data = array_merge($data, [ |
|
45 | + 'client_id' => config('skeleton.passport_client_id'), |
|
46 | + 'client_secret' => config('skeleton.passport_client_secret'), |
|
47 | + 'grant_type' => $grantType |
|
48 | + ]); |
|
49 | 49 | |
50 | - $response = \ApiConsumer::post('/oauth/token', $data); |
|
50 | + $response = \ApiConsumer::post('/oauth/token', $data); |
|
51 | 51 | |
52 | - if (! $response->isSuccessful()) { |
|
53 | - if ($grantType == 'refresh_token') { |
|
54 | - \ErrorHandler::invalidRefreshToken(); |
|
55 | - } |
|
52 | + if (! $response->isSuccessful()) { |
|
53 | + if ($grantType == 'refresh_token') { |
|
54 | + \ErrorHandler::invalidRefreshToken(); |
|
55 | + } |
|
56 | 56 | |
57 | - \ErrorHandler::loginFailed(); |
|
58 | - } |
|
57 | + \ErrorHandler::loginFailed(); |
|
58 | + } |
|
59 | 59 | |
60 | - $data = json_decode($response->getContent()); |
|
60 | + $data = json_decode($response->getContent()); |
|
61 | 61 | |
62 | - return [ |
|
63 | - 'access_token' => $data->access_token, |
|
64 | - 'refresh_token' => $data->refresh_token, |
|
65 | - 'expires_in' => $data->expires_in |
|
66 | - ]; |
|
67 | - } |
|
62 | + return [ |
|
63 | + 'access_token' => $data->access_token, |
|
64 | + 'refresh_token' => $data->refresh_token, |
|
65 | + 'expires_in' => $data->expires_in |
|
66 | + ]; |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * Logs out the user. We revoke access token and refresh token. |
|
71 | - * |
|
72 | - * @return void |
|
73 | - */ |
|
74 | - public function logout() |
|
75 | - { |
|
76 | - \Core::users()->revokeAccessToken(\Auth::user()->token()); |
|
77 | - } |
|
69 | + /** |
|
70 | + * Logs out the user. We revoke access token and refresh token. |
|
71 | + * |
|
72 | + * @return void |
|
73 | + */ |
|
74 | + public function logout() |
|
75 | + { |
|
76 | + \Core::users()->revokeAccessToken(\Auth::user()->token()); |
|
77 | + } |
|
78 | 78 | } |
@@ -6,53 +6,53 @@ |
||
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 | } |
@@ -6,69 +6,69 @@ |
||
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 | } |
@@ -8,53 +8,53 @@ |
||
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 | } |