@@ -6,29 +6,29 @@ |
||
6 | 6 | |
7 | 7 | class UpdateOauthClient 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:oauth_clients,id', |
|
28 | - 'name' => 'required|max:255', |
|
29 | - 'redirect' => 'required|url', |
|
30 | - 'user_id' => 'required|exists:users,id', |
|
31 | - 'revoked' => 'boolean' |
|
32 | - ]; |
|
33 | - } |
|
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:oauth_clients,id', |
|
28 | + 'name' => 'required|max:255', |
|
29 | + 'redirect' => 'required|url', |
|
30 | + 'user_id' => 'required|exists:users,id', |
|
31 | + 'revoked' => 'boolean' |
|
32 | + ]; |
|
33 | + } |
|
34 | 34 | } |
@@ -6,28 +6,28 @@ |
||
6 | 6 | |
7 | 7 | class UpdateUser 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:users,id', |
|
28 | - 'name' => 'nullable|string', |
|
29 | - 'email' => 'required|email|unique:users,email,'.$this->get('id'), |
|
30 | - 'password' => 'nullable|min:6' |
|
31 | - ]; |
|
32 | - } |
|
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:users,id', |
|
28 | + 'name' => 'nullable|string', |
|
29 | + 'email' => 'required|email|unique:users,email,'.$this->get('id'), |
|
30 | + 'password' => 'nullable|min:6' |
|
31 | + ]; |
|
32 | + } |
|
33 | 33 | } |
@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class LoginSocial 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 | - 'auth_code' => 'required_without:access_token', |
|
28 | - 'access_token' => 'required_without:auth_code', |
|
29 | - 'type' => 'required|in:facebook,google' |
|
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 | + 'auth_code' => 'required_without:access_token', |
|
28 | + 'access_token' => 'required_without:auth_code', |
|
29 | + 'type' => 'required|in:facebook,google' |
|
30 | + ]; |
|
31 | + } |
|
32 | 32 | } |
@@ -6,28 +6,28 @@ |
||
6 | 6 | |
7 | 7 | class InsertOauthClient 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 | - 'name' => 'required|max:255', |
|
28 | - 'redirect' => 'required|url', |
|
29 | - 'user_id' => 'required|exists:users,id', |
|
30 | - 'revoked' => 'boolean' |
|
31 | - ]; |
|
32 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + return [ |
|
27 | + 'name' => 'required|max:255', |
|
28 | + 'redirect' => 'required|url', |
|
29 | + 'user_id' => 'required|exists:users,id', |
|
30 | + 'revoked' => 'boolean' |
|
31 | + ]; |
|
32 | + } |
|
33 | 33 | } |
@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class Login 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 | - 'email' => 'required|email', |
|
28 | - 'password' => 'required|min:6', |
|
29 | - 'admin' => 'nullable|boolean' |
|
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 | + 'email' => 'required|email', |
|
28 | + 'password' => 'required|min:6', |
|
29 | + 'admin' => 'nullable|boolean' |
|
30 | + ]; |
|
31 | + } |
|
32 | 32 | } |
@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class Register 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 | - 'name' => 'nullable|string', |
|
28 | - 'email' => 'required|email|unique:users,email,'.$this->get('id'), |
|
29 | - 'password' => 'required|min:6' |
|
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 | + 'name' => 'nullable|string', |
|
28 | + 'email' => 'required|email|unique:users,email,'.$this->get('id'), |
|
29 | + 'password' => 'required|min:6' |
|
30 | + ]; |
|
31 | + } |
|
32 | 32 | } |
@@ -13,62 +13,62 @@ |
||
13 | 13 | |
14 | 14 | Route::group(['prefix' => 'acl'], function () { |
15 | 15 | |
16 | - Route::group(['prefix' => 'users'], function () { |
|
16 | + Route::group(['prefix' => 'users'], function () { |
|
17 | 17 | |
18 | - Route::get('/', 'UserController@index'); |
|
19 | - Route::get('/{id}', 'UserController@find'); |
|
20 | - Route::post('/', 'UserController@insert'); |
|
21 | - Route::put('/', 'UserController@update'); |
|
22 | - Route::delete('/{id}', 'UserController@delete'); |
|
23 | - Route::get('list/deleted', 'UserController@deleted'); |
|
24 | - Route::patch('restore/{id}', 'UserController@restore'); |
|
25 | - Route::get('block/{id}', 'UserController@block'); |
|
26 | - Route::get('unblock/{id}', 'UserController@unblock'); |
|
27 | - Route::post('assign/groups', 'UserController@assignGroups'); |
|
28 | - Route::post('group/{groupName}', 'UserController@group'); |
|
18 | + Route::get('/', 'UserController@index'); |
|
19 | + Route::get('/{id}', 'UserController@find'); |
|
20 | + Route::post('/', 'UserController@insert'); |
|
21 | + Route::put('/', 'UserController@update'); |
|
22 | + Route::delete('/{id}', 'UserController@delete'); |
|
23 | + Route::get('list/deleted', 'UserController@deleted'); |
|
24 | + Route::patch('restore/{id}', 'UserController@restore'); |
|
25 | + Route::get('block/{id}', 'UserController@block'); |
|
26 | + Route::get('unblock/{id}', 'UserController@unblock'); |
|
27 | + Route::post('assign/groups', 'UserController@assignGroups'); |
|
28 | + Route::post('group/{groupName}', 'UserController@group'); |
|
29 | 29 | |
30 | - Route::group(['prefix' => 'account'], function () { |
|
30 | + Route::group(['prefix' => 'account'], function () { |
|
31 | 31 | |
32 | - Route::get('my', 'UserController@account'); |
|
33 | - Route::get('logout', 'UserController@logout'); |
|
34 | - Route::post('refresh/token', 'UserController@refreshToken'); |
|
35 | - Route::post('save', 'UserController@saveProfile'); |
|
36 | - Route::post('register', 'UserController@register'); |
|
37 | - Route::post('login', 'UserController@login'); |
|
38 | - Route::post('login/social', 'UserController@loginSocial'); |
|
39 | - Route::post('send/reset', 'UserController@sendReset'); |
|
40 | - Route::post('reset/password', 'UserController@resetPassword'); |
|
41 | - Route::post('change/password', 'UserController@changePassword'); |
|
42 | - Route::post('confirm/email', 'UserController@confirmEmail'); |
|
43 | - Route::post('resend/email/confirmation', 'UserController@resendEmailConfirmation'); |
|
44 | - }); |
|
45 | - }); |
|
32 | + Route::get('my', 'UserController@account'); |
|
33 | + Route::get('logout', 'UserController@logout'); |
|
34 | + Route::post('refresh/token', 'UserController@refreshToken'); |
|
35 | + Route::post('save', 'UserController@saveProfile'); |
|
36 | + Route::post('register', 'UserController@register'); |
|
37 | + Route::post('login', 'UserController@login'); |
|
38 | + Route::post('login/social', 'UserController@loginSocial'); |
|
39 | + Route::post('send/reset', 'UserController@sendReset'); |
|
40 | + Route::post('reset/password', 'UserController@resetPassword'); |
|
41 | + Route::post('change/password', 'UserController@changePassword'); |
|
42 | + Route::post('confirm/email', 'UserController@confirmEmail'); |
|
43 | + Route::post('resend/email/confirmation', 'UserController@resendEmailConfirmation'); |
|
44 | + }); |
|
45 | + }); |
|
46 | 46 | |
47 | - Route::group(['prefix' => 'groups'], function () { |
|
47 | + Route::group(['prefix' => 'groups'], function () { |
|
48 | 48 | |
49 | - Route::get('/', 'GroupController@index'); |
|
50 | - Route::get('/{id}', 'GroupController@find'); |
|
51 | - Route::post('/', 'GroupController@insert'); |
|
52 | - Route::put('/', 'GroupController@update'); |
|
53 | - Route::delete('/{id}', 'GroupController@delete'); |
|
54 | - Route::get('list/deleted', 'GroupController@deleted'); |
|
55 | - Route::patch('restore/{id}', 'GroupController@restore'); |
|
56 | - Route::post('assign/permissions', 'GroupController@assignPermissions'); |
|
57 | - }); |
|
49 | + Route::get('/', 'GroupController@index'); |
|
50 | + Route::get('/{id}', 'GroupController@find'); |
|
51 | + Route::post('/', 'GroupController@insert'); |
|
52 | + Route::put('/', 'GroupController@update'); |
|
53 | + Route::delete('/{id}', 'GroupController@delete'); |
|
54 | + Route::get('list/deleted', 'GroupController@deleted'); |
|
55 | + Route::patch('restore/{id}', 'GroupController@restore'); |
|
56 | + Route::post('assign/permissions', 'GroupController@assignPermissions'); |
|
57 | + }); |
|
58 | 58 | |
59 | - Route::group(['prefix' => 'permissions'], function () { |
|
59 | + Route::group(['prefix' => 'permissions'], function () { |
|
60 | 60 | |
61 | - Route::get('/', 'PermissionController@index'); |
|
62 | - Route::get('/{id}', 'PermissionController@find'); |
|
63 | - }); |
|
61 | + Route::get('/', 'PermissionController@index'); |
|
62 | + Route::get('/{id}', 'PermissionController@find'); |
|
63 | + }); |
|
64 | 64 | |
65 | - Route::group(['prefix' => 'oauth/clients'], function () { |
|
65 | + Route::group(['prefix' => 'oauth/clients'], function () { |
|
66 | 66 | |
67 | - Route::get('/', 'OauthClientController@index'); |
|
68 | - Route::get('/{id}', 'OauthClientController@find'); |
|
69 | - Route::post('/', 'OauthClientController@insert'); |
|
70 | - Route::put('/', 'OauthClientController@update'); |
|
71 | - Route::get('revoke/{id}', 'OauthClientController@revoke'); |
|
72 | - Route::get('unrevoke/{id}', 'OauthClientController@unRevoke'); |
|
73 | - }); |
|
67 | + Route::get('/', 'OauthClientController@index'); |
|
68 | + Route::get('/{id}', 'OauthClientController@find'); |
|
69 | + Route::post('/', 'OauthClientController@insert'); |
|
70 | + Route::put('/', 'OauthClientController@update'); |
|
71 | + Route::get('revoke/{id}', 'OauthClientController@revoke'); |
|
72 | + Route::get('unrevoke/{id}', 'OauthClientController@unRevoke'); |
|
73 | + }); |
|
74 | 74 | }); |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | |
14 | -Route::group(['prefix' => 'acl'], function () { |
|
14 | +Route::group(['prefix' => 'acl'], function() { |
|
15 | 15 | |
16 | - Route::group(['prefix' => 'users'], function () { |
|
16 | + Route::group(['prefix' => 'users'], function() { |
|
17 | 17 | |
18 | 18 | Route::get('/', 'UserController@index'); |
19 | 19 | Route::get('/{id}', 'UserController@find'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | Route::post('assign/groups', 'UserController@assignGroups'); |
28 | 28 | Route::post('group/{groupName}', 'UserController@group'); |
29 | 29 | |
30 | - Route::group(['prefix' => 'account'], function () { |
|
30 | + Route::group(['prefix' => 'account'], function() { |
|
31 | 31 | |
32 | 32 | Route::get('my', 'UserController@account'); |
33 | 33 | Route::get('logout', 'UserController@logout'); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | }); |
45 | 45 | }); |
46 | 46 | |
47 | - Route::group(['prefix' => 'groups'], function () { |
|
47 | + Route::group(['prefix' => 'groups'], function() { |
|
48 | 48 | |
49 | 49 | Route::get('/', 'GroupController@index'); |
50 | 50 | Route::get('/{id}', 'GroupController@find'); |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | Route::post('assign/permissions', 'GroupController@assignPermissions'); |
57 | 57 | }); |
58 | 58 | |
59 | - Route::group(['prefix' => 'permissions'], function () { |
|
59 | + Route::group(['prefix' => 'permissions'], function() { |
|
60 | 60 | |
61 | 61 | Route::get('/', 'PermissionController@index'); |
62 | 62 | Route::get('/{id}', 'PermissionController@find'); |
63 | 63 | }); |
64 | 64 | |
65 | - Route::group(['prefix' => 'oauth/clients'], function () { |
|
65 | + Route::group(['prefix' => 'oauth/clients'], function() { |
|
66 | 66 | |
67 | 67 | Route::get('/', 'OauthClientController@index'); |
68 | 68 | Route::get('/{id}', 'OauthClientController@find'); |
@@ -6,42 +6,42 @@ |
||
6 | 6 | class AclGroup extends Model |
7 | 7 | { |
8 | 8 | |
9 | - use SoftDeletes; |
|
10 | - protected $table = 'groups'; |
|
11 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
12 | - protected $hidden = ['deleted_at']; |
|
13 | - protected $guarded = ['id']; |
|
14 | - protected $fillable = ['name']; |
|
15 | - public $searchable = ['name']; |
|
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 | - |
|
32 | - public function users() |
|
33 | - { |
|
34 | - return $this->belongsToMany('App\Modules\Acl\AclUser', 'users_groups', 'group_id', 'user_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
35 | - } |
|
36 | - |
|
37 | - public function permissions() |
|
38 | - { |
|
39 | - return $this->belongsToMany('App\Modules\Acl\AclPermission', 'groups_permissions', 'group_id', 'permission_id')->whereNull('groups_permissions.deleted_at')->withTimestamps(); |
|
40 | - } |
|
41 | - |
|
42 | - public static function boot() |
|
43 | - { |
|
44 | - parent::boot(); |
|
45 | - AclGroup::observe(\App::make('App\Modules\Acl\ModelObservers\AclGroupObserver')); |
|
46 | - } |
|
9 | + use SoftDeletes; |
|
10 | + protected $table = 'groups'; |
|
11 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
12 | + protected $hidden = ['deleted_at']; |
|
13 | + protected $guarded = ['id']; |
|
14 | + protected $fillable = ['name']; |
|
15 | + public $searchable = ['name']; |
|
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 | + |
|
32 | + public function users() |
|
33 | + { |
|
34 | + return $this->belongsToMany('App\Modules\Acl\AclUser', 'users_groups', 'group_id', 'user_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
35 | + } |
|
36 | + |
|
37 | + public function permissions() |
|
38 | + { |
|
39 | + return $this->belongsToMany('App\Modules\Acl\AclPermission', 'groups_permissions', 'group_id', 'permission_id')->whereNull('groups_permissions.deleted_at')->withTimestamps(); |
|
40 | + } |
|
41 | + |
|
42 | + public static function boot() |
|
43 | + { |
|
44 | + parent::boot(); |
|
45 | + AclGroup::observe(\App::make('App\Modules\Acl\ModelObservers\AclGroupObserver')); |
|
46 | + } |
|
47 | 47 | } |
@@ -6,88 +6,88 @@ |
||
6 | 6 | |
7 | 7 | class UsersTableSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - /** |
|
17 | - * Insert the permissions related to users table. |
|
18 | - */ |
|
19 | - \DB::table('permissions')->insert( |
|
20 | - [ |
|
21 | - /** |
|
22 | - * Users model permissions. |
|
23 | - */ |
|
24 | - [ |
|
25 | - 'name' => 'index', |
|
26 | - 'model' => 'user', |
|
27 | - 'created_at' => \DB::raw('NOW()'), |
|
28 | - 'updated_at' => \DB::raw('NOW()') |
|
29 | - ], |
|
30 | - [ |
|
31 | - 'name' => 'find', |
|
32 | - 'model' => 'user', |
|
33 | - 'created_at' => \DB::raw('NOW()'), |
|
34 | - 'updated_at' => \DB::raw('NOW()') |
|
35 | - ], |
|
36 | - [ |
|
37 | - 'name' => 'insert', |
|
38 | - 'model' => 'user', |
|
39 | - 'created_at' => \DB::raw('NOW()'), |
|
40 | - 'updated_at' => \DB::raw('NOW()') |
|
41 | - ], |
|
42 | - [ |
|
43 | - 'name' => 'update', |
|
44 | - 'model' => 'user', |
|
45 | - 'created_at' => \DB::raw('NOW()'), |
|
46 | - 'updated_at' => \DB::raw('NOW()') |
|
47 | - ], |
|
48 | - [ |
|
49 | - 'name' => 'delete', |
|
50 | - 'model' => 'user', |
|
51 | - 'created_at' => \DB::raw('NOW()'), |
|
52 | - 'updated_at' => \DB::raw('NOW()') |
|
53 | - ], |
|
54 | - [ |
|
55 | - 'name' => 'deleted', |
|
56 | - 'model' => 'user', |
|
57 | - 'created_at' => \DB::raw('NOW()'), |
|
58 | - 'updated_at' => \DB::raw('NOW()') |
|
59 | - ], |
|
60 | - [ |
|
61 | - 'name' => 'restore', |
|
62 | - 'model' => 'user', |
|
63 | - 'created_at' => \DB::raw('NOW()'), |
|
64 | - 'updated_at' => \DB::raw('NOW()') |
|
65 | - ], |
|
66 | - [ |
|
67 | - 'name' => 'assignGroups', |
|
68 | - 'model' => 'user', |
|
69 | - 'created_at' => \DB::raw('NOW()'), |
|
70 | - 'updated_at' => \DB::raw('NOW()') |
|
71 | - ], |
|
72 | - [ |
|
73 | - 'name' => 'block', |
|
74 | - 'model' => 'user', |
|
75 | - 'created_at' => \DB::raw('NOW()'), |
|
76 | - 'updated_at' => \DB::raw('NOW()') |
|
77 | - ], |
|
78 | - [ |
|
79 | - 'name' => 'unblock', |
|
80 | - 'model' => 'user', |
|
81 | - 'created_at' => \DB::raw('NOW()'), |
|
82 | - 'updated_at' => \DB::raw('NOW()') |
|
83 | - ], |
|
84 | - [ |
|
85 | - 'name' => 'group', |
|
86 | - 'model' => 'user', |
|
87 | - 'created_at' => \DB::raw('NOW()'), |
|
88 | - 'updated_at' => \DB::raw('NOW()') |
|
89 | - ] |
|
90 | - ] |
|
91 | - ); |
|
92 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + /** |
|
17 | + * Insert the permissions related to users table. |
|
18 | + */ |
|
19 | + \DB::table('permissions')->insert( |
|
20 | + [ |
|
21 | + /** |
|
22 | + * Users model permissions. |
|
23 | + */ |
|
24 | + [ |
|
25 | + 'name' => 'index', |
|
26 | + 'model' => 'user', |
|
27 | + 'created_at' => \DB::raw('NOW()'), |
|
28 | + 'updated_at' => \DB::raw('NOW()') |
|
29 | + ], |
|
30 | + [ |
|
31 | + 'name' => 'find', |
|
32 | + 'model' => 'user', |
|
33 | + 'created_at' => \DB::raw('NOW()'), |
|
34 | + 'updated_at' => \DB::raw('NOW()') |
|
35 | + ], |
|
36 | + [ |
|
37 | + 'name' => 'insert', |
|
38 | + 'model' => 'user', |
|
39 | + 'created_at' => \DB::raw('NOW()'), |
|
40 | + 'updated_at' => \DB::raw('NOW()') |
|
41 | + ], |
|
42 | + [ |
|
43 | + 'name' => 'update', |
|
44 | + 'model' => 'user', |
|
45 | + 'created_at' => \DB::raw('NOW()'), |
|
46 | + 'updated_at' => \DB::raw('NOW()') |
|
47 | + ], |
|
48 | + [ |
|
49 | + 'name' => 'delete', |
|
50 | + 'model' => 'user', |
|
51 | + 'created_at' => \DB::raw('NOW()'), |
|
52 | + 'updated_at' => \DB::raw('NOW()') |
|
53 | + ], |
|
54 | + [ |
|
55 | + 'name' => 'deleted', |
|
56 | + 'model' => 'user', |
|
57 | + 'created_at' => \DB::raw('NOW()'), |
|
58 | + 'updated_at' => \DB::raw('NOW()') |
|
59 | + ], |
|
60 | + [ |
|
61 | + 'name' => 'restore', |
|
62 | + 'model' => 'user', |
|
63 | + 'created_at' => \DB::raw('NOW()'), |
|
64 | + 'updated_at' => \DB::raw('NOW()') |
|
65 | + ], |
|
66 | + [ |
|
67 | + 'name' => 'assignGroups', |
|
68 | + 'model' => 'user', |
|
69 | + 'created_at' => \DB::raw('NOW()'), |
|
70 | + 'updated_at' => \DB::raw('NOW()') |
|
71 | + ], |
|
72 | + [ |
|
73 | + 'name' => 'block', |
|
74 | + 'model' => 'user', |
|
75 | + 'created_at' => \DB::raw('NOW()'), |
|
76 | + 'updated_at' => \DB::raw('NOW()') |
|
77 | + ], |
|
78 | + [ |
|
79 | + 'name' => 'unblock', |
|
80 | + 'model' => 'user', |
|
81 | + 'created_at' => \DB::raw('NOW()'), |
|
82 | + 'updated_at' => \DB::raw('NOW()') |
|
83 | + ], |
|
84 | + [ |
|
85 | + 'name' => 'group', |
|
86 | + 'model' => 'user', |
|
87 | + 'created_at' => \DB::raw('NOW()'), |
|
88 | + 'updated_at' => \DB::raw('NOW()') |
|
89 | + ] |
|
90 | + ] |
|
91 | + ); |
|
92 | + } |
|
93 | 93 | } |