@@ -2,87 +2,87 @@ |
||
2 | 2 | |
3 | 3 | class ErrorHandler |
4 | 4 | { |
5 | - public function unAuthorized() |
|
6 | - { |
|
7 | - $error = ['status' => 401, 'message' => trans('errors.unAuthorized')]; |
|
8 | - abort($error['status'], $error['message']); |
|
9 | - } |
|
5 | + public function unAuthorized() |
|
6 | + { |
|
7 | + $error = ['status' => 401, 'message' => trans('errors.unAuthorized')]; |
|
8 | + abort($error['status'], $error['message']); |
|
9 | + } |
|
10 | 10 | |
11 | - public function tokenExpired() |
|
12 | - { |
|
13 | - $error = ['status' => 403, 'message' => trans('errors.tokenExpired')]; |
|
14 | - abort($error['status'], $error['message']); |
|
15 | - } |
|
11 | + public function tokenExpired() |
|
12 | + { |
|
13 | + $error = ['status' => 403, 'message' => trans('errors.tokenExpired')]; |
|
14 | + abort($error['status'], $error['message']); |
|
15 | + } |
|
16 | 16 | |
17 | - public function noPermissions() |
|
18 | - { |
|
19 | - $error = ['status' => 403, 'message' => trans('errors.noPermissions')]; |
|
20 | - abort($error['status'], $error['message']); |
|
21 | - } |
|
17 | + public function noPermissions() |
|
18 | + { |
|
19 | + $error = ['status' => 403, 'message' => trans('errors.noPermissions')]; |
|
20 | + abort($error['status'], $error['message']); |
|
21 | + } |
|
22 | 22 | |
23 | - public function loginFailed() |
|
24 | - { |
|
25 | - $error = ['status' => 400, 'message' => trans('errors.loginFailed')]; |
|
26 | - abort($error['status'], $error['message']); |
|
27 | - } |
|
23 | + public function loginFailed() |
|
24 | + { |
|
25 | + $error = ['status' => 400, 'message' => trans('errors.loginFailed')]; |
|
26 | + abort($error['status'], $error['message']); |
|
27 | + } |
|
28 | 28 | |
29 | - public function redisNotRunning() |
|
30 | - { |
|
31 | - $error = ['status' => 400, 'message' => trans('errors.redisNotRunning')]; |
|
32 | - abort($error['status'], $error['message']); |
|
33 | - } |
|
29 | + public function redisNotRunning() |
|
30 | + { |
|
31 | + $error = ['status' => 400, 'message' => trans('errors.redisNotRunning')]; |
|
32 | + abort($error['status'], $error['message']); |
|
33 | + } |
|
34 | 34 | |
35 | - public function dbQueryError() |
|
36 | - { |
|
37 | - $error = ['status' => 400, 'message' => trans('errors.dbQueryError')]; |
|
38 | - abort($error['status'], $error['message']); |
|
39 | - } |
|
35 | + public function dbQueryError() |
|
36 | + { |
|
37 | + $error = ['status' => 400, 'message' => trans('errors.dbQueryError')]; |
|
38 | + abort($error['status'], $error['message']); |
|
39 | + } |
|
40 | 40 | |
41 | - public function cannotCreateSetting() |
|
42 | - { |
|
43 | - $error = ['status' => 400, 'message' => trans('errors.cannotCreateSetting')]; |
|
44 | - abort($error['status'], $error['message']); |
|
45 | - } |
|
41 | + public function cannotCreateSetting() |
|
42 | + { |
|
43 | + $error = ['status' => 400, 'message' => trans('errors.cannotCreateSetting')]; |
|
44 | + abort($error['status'], $error['message']); |
|
45 | + } |
|
46 | 46 | |
47 | - public function cannotUpdateSettingKey() |
|
48 | - { |
|
49 | - $error = ['status' => 400, 'message' => trans('errors.cannotUpdateSettingKey')]; |
|
50 | - abort($error['status'], $error['message']); |
|
51 | - } |
|
47 | + public function cannotUpdateSettingKey() |
|
48 | + { |
|
49 | + $error = ['status' => 400, 'message' => trans('errors.cannotUpdateSettingKey')]; |
|
50 | + abort($error['status'], $error['message']); |
|
51 | + } |
|
52 | 52 | |
53 | - public function userIsBlocked() |
|
54 | - { |
|
55 | - $error = ['status' => 403, 'message' => trans('errors.userIsBlocked')]; |
|
56 | - abort($error['status'], $error['message']); |
|
57 | - } |
|
53 | + public function userIsBlocked() |
|
54 | + { |
|
55 | + $error = ['status' => 403, 'message' => trans('errors.userIsBlocked')]; |
|
56 | + abort($error['status'], $error['message']); |
|
57 | + } |
|
58 | 58 | |
59 | - public function invalidResetToken() |
|
60 | - { |
|
61 | - $error = ['status' => 400, 'message' => trans('errors.invalidResetToken')]; |
|
62 | - abort($error['status'], $error['message']); |
|
63 | - } |
|
59 | + public function invalidResetToken() |
|
60 | + { |
|
61 | + $error = ['status' => 400, 'message' => trans('errors.invalidResetToken')]; |
|
62 | + abort($error['status'], $error['message']); |
|
63 | + } |
|
64 | 64 | |
65 | - public function invalidResetPassword() |
|
66 | - { |
|
67 | - $error = ['status' => 400, 'message' => trans('errors.invalidResetPassword')]; |
|
68 | - abort($error['status'], $error['message']); |
|
69 | - } |
|
65 | + public function invalidResetPassword() |
|
66 | + { |
|
67 | + $error = ['status' => 400, 'message' => trans('errors.invalidResetPassword')]; |
|
68 | + abort($error['status'], $error['message']); |
|
69 | + } |
|
70 | 70 | |
71 | - public function invalidOldPassword() |
|
72 | - { |
|
73 | - $error = ['status' => 400, 'message' => trans('errors.invalidOldPassword')]; |
|
74 | - abort($error['status'], $error['message']); |
|
75 | - } |
|
71 | + public function invalidOldPassword() |
|
72 | + { |
|
73 | + $error = ['status' => 400, 'message' => trans('errors.invalidOldPassword')]; |
|
74 | + abort($error['status'], $error['message']); |
|
75 | + } |
|
76 | 76 | |
77 | - public function notFound($text) |
|
78 | - { |
|
79 | - $error = ['status' => 404, 'message' => trans('errors.notFound', ['replace' => $text])]; |
|
80 | - abort($error['status'], $error['message']); |
|
81 | - } |
|
77 | + public function notFound($text) |
|
78 | + { |
|
79 | + $error = ['status' => 404, 'message' => trans('errors.notFound', ['replace' => $text])]; |
|
80 | + abort($error['status'], $error['message']); |
|
81 | + } |
|
82 | 82 | |
83 | - public function generalError() |
|
84 | - { |
|
85 | - $error = ['status' => 404, 'message' => trans('errors.generalError')]; |
|
86 | - abort($error['status'], $error['message']); |
|
87 | - } |
|
83 | + public function generalError() |
|
84 | + { |
|
85 | + $error = ['status' => 404, 'message' => trans('errors.generalError')]; |
|
86 | + abort($error['status'], $error['message']); |
|
87 | + } |
|
88 | 88 | } |
89 | 89 | \ No newline at end of file |
@@ -15,14 +15,14 @@ |
||
15 | 15 | Schema::create('notifications', function (Blueprint $table) { |
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('key', 100); |
18 | - $table->text('data'); |
|
18 | + $table->text('data'); |
|
19 | 19 | $table->string('item_name',100); |
20 | 20 | $table->string('item_type',100); |
21 | 21 | $table->integer('item_id'); |
22 | 22 | $table->boolean('notified'); |
23 | 23 | $table->softDeletes(); |
24 | 24 | $table->timestamps(); |
25 | - }); |
|
25 | + }); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -12,12 +12,12 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('notifications', function (Blueprint $table) { |
|
15 | + Schema::create('notifications', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('key', 100); |
18 | 18 | $table->text('data'); |
19 | - $table->string('item_name',100); |
|
20 | - $table->string('item_type',100); |
|
19 | + $table->string('item_name', 100); |
|
20 | + $table->string('item_type', 100); |
|
21 | 21 | $table->integer('item_id'); |
22 | 22 | $table->boolean('notified'); |
23 | 23 | $table->softDeletes(); |
@@ -5,48 +5,48 @@ |
||
5 | 5 | |
6 | 6 | class Notification extends Model{ |
7 | 7 | |
8 | - use SoftDeletes; |
|
9 | - protected $table = 'notifications'; |
|
10 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
11 | - protected $hidden = ['deleted_at', 'item_type', 'data']; |
|
12 | - protected $guarded = ['id']; |
|
13 | - protected $fillable = ['key', 'data', 'item_name', 'item_type', 'item_id', 'notified']; |
|
14 | - protected $appends = ['description']; |
|
15 | - public $searchable = ['key', 'item_name', 'item_type']; |
|
16 | - |
|
17 | - public function getCreatedAtAttribute($value) |
|
18 | - { |
|
19 | - return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
20 | - } |
|
21 | - |
|
22 | - public function getUpdatedAtAttribute($value) |
|
23 | - { |
|
24 | - return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
25 | - } |
|
26 | - |
|
27 | - public function getDeletedAtAttribute($value) |
|
28 | - { |
|
29 | - return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
30 | - } |
|
8 | + use SoftDeletes; |
|
9 | + protected $table = 'notifications'; |
|
10 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
11 | + protected $hidden = ['deleted_at', 'item_type', 'data']; |
|
12 | + protected $guarded = ['id']; |
|
13 | + protected $fillable = ['key', 'data', 'item_name', 'item_type', 'item_id', 'notified']; |
|
14 | + protected $appends = ['description']; |
|
15 | + public $searchable = ['key', 'item_name', 'item_type']; |
|
16 | + |
|
17 | + public function getCreatedAtAttribute($value) |
|
18 | + { |
|
19 | + return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
20 | + } |
|
21 | + |
|
22 | + public function getUpdatedAtAttribute($value) |
|
23 | + { |
|
24 | + return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
25 | + } |
|
26 | + |
|
27 | + public function getDeletedAtAttribute($value) |
|
28 | + { |
|
29 | + return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
30 | + } |
|
31 | 31 | |
32 | - public function item() |
|
33 | - { |
|
34 | - return $this->morphTo(); |
|
35 | - } |
|
36 | - |
|
37 | - public function setDataAttribute($value) |
|
38 | - { |
|
39 | - $this->attributes['data'] = serialize($value); |
|
40 | - } |
|
41 | - |
|
42 | - public function getDescriptionAttribute() |
|
43 | - { |
|
44 | - return trans('notifications.' . $this->attributes['key'], unserialize($this->attributes['data'])); |
|
45 | - } |
|
46 | - |
|
47 | - public static function boot() |
|
48 | - { |
|
49 | - parent::boot(); |
|
50 | - parent::observe(\App::make('App\Modules\V1\Notifications\ModelObservers\NotificationObserver')); |
|
51 | - } |
|
32 | + public function item() |
|
33 | + { |
|
34 | + return $this->morphTo(); |
|
35 | + } |
|
36 | + |
|
37 | + public function setDataAttribute($value) |
|
38 | + { |
|
39 | + $this->attributes['data'] = serialize($value); |
|
40 | + } |
|
41 | + |
|
42 | + public function getDescriptionAttribute() |
|
43 | + { |
|
44 | + return trans('notifications.' . $this->attributes['key'], unserialize($this->attributes['data'])); |
|
45 | + } |
|
46 | + |
|
47 | + public static function boot() |
|
48 | + { |
|
49 | + parent::boot(); |
|
50 | + parent::observe(\App::make('App\Modules\V1\Notifications\ModelObservers\NotificationObserver')); |
|
51 | + } |
|
52 | 52 | } |
@@ -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() |
@@ -5,62 +5,62 @@ |
||
5 | 5 | */ |
6 | 6 | class AclGroupObserver { |
7 | 7 | |
8 | - public function saving($model) |
|
9 | - { |
|
10 | - // |
|
11 | - } |
|
8 | + public function saving($model) |
|
9 | + { |
|
10 | + // |
|
11 | + } |
|
12 | 12 | |
13 | - public function saved($model) |
|
14 | - { |
|
15 | - // |
|
16 | - } |
|
13 | + public function saved($model) |
|
14 | + { |
|
15 | + // |
|
16 | + } |
|
17 | 17 | |
18 | - public function creating($model) |
|
19 | - { |
|
20 | - // |
|
21 | - } |
|
18 | + public function creating($model) |
|
19 | + { |
|
20 | + // |
|
21 | + } |
|
22 | 22 | |
23 | - public function created($model) |
|
24 | - { |
|
25 | - // |
|
26 | - } |
|
23 | + public function created($model) |
|
24 | + { |
|
25 | + // |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Prevent updating of the admin group. |
|
30 | - * |
|
31 | - * @param object $model the model beign updated. |
|
32 | - * @return void |
|
33 | - */ |
|
34 | - public function updating($model) |
|
35 | - { |
|
36 | - if ($model->getOriginal('name') == 'Admin') |
|
37 | - { |
|
38 | - \ErrorHandler::noPermissions(); |
|
39 | - } |
|
40 | - } |
|
28 | + /** |
|
29 | + * Prevent updating of the admin group. |
|
30 | + * |
|
31 | + * @param object $model the model beign updated. |
|
32 | + * @return void |
|
33 | + */ |
|
34 | + public function updating($model) |
|
35 | + { |
|
36 | + if ($model->getOriginal('name') == 'Admin') |
|
37 | + { |
|
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 | - { |
|
57 | - \ErrorHandler::noPermissions(); |
|
58 | - } |
|
59 | - } |
|
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 | + { |
|
57 | + \ErrorHandler::noPermissions(); |
|
58 | + } |
|
59 | + } |
|
60 | 60 | |
61 | - public function deleted($model) |
|
62 | - { |
|
63 | - // |
|
64 | - } |
|
61 | + public function deleted($model) |
|
62 | + { |
|
63 | + // |
|
64 | + } |
|
65 | 65 | |
66 | 66 | } |
67 | 67 | \ No newline at end of file |
@@ -5,54 +5,54 @@ |
||
5 | 5 | */ |
6 | 6 | class AclUserObserver { |
7 | 7 | |
8 | - public function saving($model) |
|
9 | - { |
|
10 | - // |
|
11 | - } |
|
12 | - |
|
13 | - public function saved($model) |
|
14 | - { |
|
15 | - // |
|
16 | - } |
|
17 | - |
|
18 | - public function creating($model) |
|
19 | - { |
|
20 | - // |
|
21 | - } |
|
22 | - |
|
23 | - public function created($model) |
|
24 | - { |
|
25 | - // |
|
26 | - } |
|
27 | - |
|
28 | - public function updating($model) |
|
29 | - { |
|
30 | - // |
|
31 | - } |
|
32 | - |
|
33 | - public function updated($model) |
|
34 | - { |
|
35 | - // |
|
36 | - } |
|
37 | - |
|
38 | - /** |
|
39 | - * Soft delete user logs. |
|
40 | - * |
|
41 | - * @param object $model the delted model. |
|
42 | - * @return void |
|
43 | - */ |
|
44 | - public function deleting($model) |
|
45 | - { |
|
46 | - if ($model->getOriginal('id') == \JWTAuth::parseToken()->authenticate()->id) |
|
47 | - { |
|
48 | - \ErrorHandler::noPermissions(); |
|
49 | - } |
|
50 | - $model->logs()->delete(); |
|
51 | - } |
|
52 | - |
|
53 | - public function deleted($model) |
|
54 | - { |
|
55 | - // |
|
56 | - } |
|
8 | + public function saving($model) |
|
9 | + { |
|
10 | + // |
|
11 | + } |
|
12 | + |
|
13 | + public function saved($model) |
|
14 | + { |
|
15 | + // |
|
16 | + } |
|
17 | + |
|
18 | + public function creating($model) |
|
19 | + { |
|
20 | + // |
|
21 | + } |
|
22 | + |
|
23 | + public function created($model) |
|
24 | + { |
|
25 | + // |
|
26 | + } |
|
27 | + |
|
28 | + public function updating($model) |
|
29 | + { |
|
30 | + // |
|
31 | + } |
|
32 | + |
|
33 | + public function updated($model) |
|
34 | + { |
|
35 | + // |
|
36 | + } |
|
37 | + |
|
38 | + /** |
|
39 | + * Soft delete user logs. |
|
40 | + * |
|
41 | + * @param object $model the delted model. |
|
42 | + * @return void |
|
43 | + */ |
|
44 | + public function deleting($model) |
|
45 | + { |
|
46 | + if ($model->getOriginal('id') == \JWTAuth::parseToken()->authenticate()->id) |
|
47 | + { |
|
48 | + \ErrorHandler::noPermissions(); |
|
49 | + } |
|
50 | + $model->logs()->delete(); |
|
51 | + } |
|
52 | + |
|
53 | + public function deleted($model) |
|
54 | + { |
|
55 | + // |
|
56 | + } |
|
57 | 57 | |
58 | 58 | } |
59 | 59 | \ No newline at end of file |
@@ -13,203 +13,203 @@ discard block |
||
13 | 13 | public function up() |
14 | 14 | { |
15 | 15 | /** |
16 | - * Insert the permissions related to this module. |
|
17 | - */ |
|
18 | - DB::table('permissions')->insert( |
|
19 | - [ |
|
20 | - /** |
|
21 | - * Users model permissions. |
|
22 | - */ |
|
23 | - [ |
|
24 | - 'name' => 'save', |
|
25 | - 'model' => 'users', |
|
26 | - 'created_at' => \DB::raw('NOW()'), |
|
27 | - 'updated_at' => \DB::raw('NOW()') |
|
28 | - ], |
|
29 | - [ |
|
30 | - 'name' => 'delete', |
|
31 | - 'model' => 'users', |
|
32 | - 'created_at' => \DB::raw('NOW()'), |
|
33 | - 'updated_at' => \DB::raw('NOW()') |
|
34 | - ], |
|
35 | - [ |
|
36 | - 'name' => 'find', |
|
37 | - 'model' => 'users', |
|
38 | - 'created_at' => \DB::raw('NOW()'), |
|
39 | - 'updated_at' => \DB::raw('NOW()') |
|
40 | - ], |
|
41 | - [ |
|
42 | - 'name' => 'list', |
|
43 | - 'model' => 'users', |
|
44 | - 'created_at' => \DB::raw('NOW()'), |
|
45 | - 'updated_at' => \DB::raw('NOW()') |
|
46 | - ], |
|
47 | - [ |
|
48 | - 'name' => 'search', |
|
49 | - 'model' => 'users', |
|
50 | - 'created_at' => \DB::raw('NOW()'), |
|
51 | - 'updated_at' => \DB::raw('NOW()') |
|
52 | - ], |
|
53 | - [ |
|
54 | - 'name' => 'findby', |
|
55 | - 'model' => 'users', |
|
56 | - 'created_at' => \DB::raw('NOW()'), |
|
57 | - 'updated_at' => \DB::raw('NOW()') |
|
58 | - ], |
|
59 | - [ |
|
60 | - 'name' => 'first', |
|
61 | - 'model' => 'users', |
|
62 | - 'created_at' => \DB::raw('NOW()'), |
|
63 | - 'updated_at' => \DB::raw('NOW()') |
|
64 | - ], |
|
65 | - [ |
|
66 | - 'name' => 'paginate', |
|
67 | - 'model' => 'users', |
|
68 | - 'created_at' => \DB::raw('NOW()'), |
|
69 | - 'updated_at' => \DB::raw('NOW()') |
|
70 | - ], |
|
71 | - [ |
|
72 | - 'name' => 'paginateby', |
|
73 | - 'model' => 'users', |
|
74 | - 'created_at' => \DB::raw('NOW()'), |
|
75 | - 'updated_at' => \DB::raw('NOW()') |
|
76 | - ], |
|
77 | - [ |
|
78 | - 'name' => 'assigngroups', |
|
79 | - 'model' => 'users', |
|
80 | - 'created_at' => \DB::raw('NOW()'), |
|
81 | - 'updated_at' => \DB::raw('NOW()') |
|
82 | - ], |
|
83 | - [ |
|
84 | - 'name' => 'block', |
|
85 | - 'model' => 'users', |
|
86 | - 'created_at' => \DB::raw('NOW()'), |
|
87 | - 'updated_at' => \DB::raw('NOW()') |
|
88 | - ], |
|
89 | - [ |
|
90 | - 'name' => 'unblock', |
|
91 | - 'model' => 'users', |
|
92 | - 'created_at' => \DB::raw('NOW()'), |
|
93 | - 'updated_at' => \DB::raw('NOW()') |
|
94 | - ], |
|
16 | + * Insert the permissions related to this module. |
|
17 | + */ |
|
18 | + DB::table('permissions')->insert( |
|
19 | + [ |
|
20 | + /** |
|
21 | + * Users model permissions. |
|
22 | + */ |
|
23 | + [ |
|
24 | + 'name' => 'save', |
|
25 | + 'model' => 'users', |
|
26 | + 'created_at' => \DB::raw('NOW()'), |
|
27 | + 'updated_at' => \DB::raw('NOW()') |
|
28 | + ], |
|
29 | + [ |
|
30 | + 'name' => 'delete', |
|
31 | + 'model' => 'users', |
|
32 | + 'created_at' => \DB::raw('NOW()'), |
|
33 | + 'updated_at' => \DB::raw('NOW()') |
|
34 | + ], |
|
35 | + [ |
|
36 | + 'name' => 'find', |
|
37 | + 'model' => 'users', |
|
38 | + 'created_at' => \DB::raw('NOW()'), |
|
39 | + 'updated_at' => \DB::raw('NOW()') |
|
40 | + ], |
|
41 | + [ |
|
42 | + 'name' => 'list', |
|
43 | + 'model' => 'users', |
|
44 | + 'created_at' => \DB::raw('NOW()'), |
|
45 | + 'updated_at' => \DB::raw('NOW()') |
|
46 | + ], |
|
47 | + [ |
|
48 | + 'name' => 'search', |
|
49 | + 'model' => 'users', |
|
50 | + 'created_at' => \DB::raw('NOW()'), |
|
51 | + 'updated_at' => \DB::raw('NOW()') |
|
52 | + ], |
|
53 | + [ |
|
54 | + 'name' => 'findby', |
|
55 | + 'model' => 'users', |
|
56 | + 'created_at' => \DB::raw('NOW()'), |
|
57 | + 'updated_at' => \DB::raw('NOW()') |
|
58 | + ], |
|
59 | + [ |
|
60 | + 'name' => 'first', |
|
61 | + 'model' => 'users', |
|
62 | + 'created_at' => \DB::raw('NOW()'), |
|
63 | + 'updated_at' => \DB::raw('NOW()') |
|
64 | + ], |
|
65 | + [ |
|
66 | + 'name' => 'paginate', |
|
67 | + 'model' => 'users', |
|
68 | + 'created_at' => \DB::raw('NOW()'), |
|
69 | + 'updated_at' => \DB::raw('NOW()') |
|
70 | + ], |
|
71 | + [ |
|
72 | + 'name' => 'paginateby', |
|
73 | + 'model' => 'users', |
|
74 | + 'created_at' => \DB::raw('NOW()'), |
|
75 | + 'updated_at' => \DB::raw('NOW()') |
|
76 | + ], |
|
77 | + [ |
|
78 | + 'name' => 'assigngroups', |
|
79 | + 'model' => 'users', |
|
80 | + 'created_at' => \DB::raw('NOW()'), |
|
81 | + 'updated_at' => \DB::raw('NOW()') |
|
82 | + ], |
|
83 | + [ |
|
84 | + 'name' => 'block', |
|
85 | + 'model' => 'users', |
|
86 | + 'created_at' => \DB::raw('NOW()'), |
|
87 | + 'updated_at' => \DB::raw('NOW()') |
|
88 | + ], |
|
89 | + [ |
|
90 | + 'name' => 'unblock', |
|
91 | + 'model' => 'users', |
|
92 | + 'created_at' => \DB::raw('NOW()'), |
|
93 | + 'updated_at' => \DB::raw('NOW()') |
|
94 | + ], |
|
95 | 95 | |
96 | - /** |
|
97 | - * Permissions model permissions. |
|
98 | - */ |
|
99 | - [ |
|
100 | - 'name' => 'find', |
|
101 | - 'model' => 'permissions', |
|
102 | - 'created_at' => \DB::raw('NOW()'), |
|
103 | - 'updated_at' => \DB::raw('NOW()') |
|
104 | - ], |
|
105 | - [ |
|
106 | - 'name' => 'search', |
|
107 | - 'model' => 'permissions', |
|
108 | - 'created_at' => \DB::raw('NOW()'), |
|
109 | - 'updated_at' => \DB::raw('NOW()') |
|
110 | - ], |
|
111 | - [ |
|
112 | - 'name' => 'list', |
|
113 | - 'model' => 'permissions', |
|
114 | - 'created_at' => \DB::raw('NOW()'), |
|
115 | - 'updated_at' => \DB::raw('NOW()') |
|
116 | - ], |
|
117 | - [ |
|
118 | - 'name' => 'findby', |
|
119 | - 'model' => 'permissions', |
|
120 | - 'created_at' => \DB::raw('NOW()'), |
|
121 | - 'updated_at' => \DB::raw('NOW()') |
|
122 | - ], |
|
123 | - [ |
|
124 | - 'name' => 'first', |
|
125 | - 'model' => 'permissions', |
|
126 | - 'created_at' => \DB::raw('NOW()'), |
|
127 | - 'updated_at' => \DB::raw('NOW()') |
|
128 | - ], |
|
129 | - [ |
|
130 | - 'name' => 'paginate', |
|
131 | - 'model' => 'permissions', |
|
132 | - 'created_at' => \DB::raw('NOW()'), |
|
133 | - 'updated_at' => \DB::raw('NOW()') |
|
134 | - ], |
|
135 | - [ |
|
136 | - 'name' => 'paginateby', |
|
137 | - 'model' => 'permissions', |
|
138 | - 'created_at' => \DB::raw('NOW()'), |
|
139 | - 'updated_at' => \DB::raw('NOW()') |
|
140 | - ], |
|
96 | + /** |
|
97 | + * Permissions model permissions. |
|
98 | + */ |
|
99 | + [ |
|
100 | + 'name' => 'find', |
|
101 | + 'model' => 'permissions', |
|
102 | + 'created_at' => \DB::raw('NOW()'), |
|
103 | + 'updated_at' => \DB::raw('NOW()') |
|
104 | + ], |
|
105 | + [ |
|
106 | + 'name' => 'search', |
|
107 | + 'model' => 'permissions', |
|
108 | + 'created_at' => \DB::raw('NOW()'), |
|
109 | + 'updated_at' => \DB::raw('NOW()') |
|
110 | + ], |
|
111 | + [ |
|
112 | + 'name' => 'list', |
|
113 | + 'model' => 'permissions', |
|
114 | + 'created_at' => \DB::raw('NOW()'), |
|
115 | + 'updated_at' => \DB::raw('NOW()') |
|
116 | + ], |
|
117 | + [ |
|
118 | + 'name' => 'findby', |
|
119 | + 'model' => 'permissions', |
|
120 | + 'created_at' => \DB::raw('NOW()'), |
|
121 | + 'updated_at' => \DB::raw('NOW()') |
|
122 | + ], |
|
123 | + [ |
|
124 | + 'name' => 'first', |
|
125 | + 'model' => 'permissions', |
|
126 | + 'created_at' => \DB::raw('NOW()'), |
|
127 | + 'updated_at' => \DB::raw('NOW()') |
|
128 | + ], |
|
129 | + [ |
|
130 | + 'name' => 'paginate', |
|
131 | + 'model' => 'permissions', |
|
132 | + 'created_at' => \DB::raw('NOW()'), |
|
133 | + 'updated_at' => \DB::raw('NOW()') |
|
134 | + ], |
|
135 | + [ |
|
136 | + 'name' => 'paginateby', |
|
137 | + 'model' => 'permissions', |
|
138 | + 'created_at' => \DB::raw('NOW()'), |
|
139 | + 'updated_at' => \DB::raw('NOW()') |
|
140 | + ], |
|
141 | 141 | |
142 | - /** |
|
143 | - * Groups model permissions. |
|
144 | - */ |
|
145 | - [ |
|
146 | - 'name' => 'save', |
|
147 | - 'model' => 'groups', |
|
148 | - 'created_at' => \DB::raw('NOW()'), |
|
149 | - 'updated_at' => \DB::raw('NOW()') |
|
150 | - ], |
|
151 | - [ |
|
152 | - 'name' => 'delete', |
|
153 | - 'model' => 'groups', |
|
154 | - 'created_at' => \DB::raw('NOW()'), |
|
155 | - 'updated_at' => \DB::raw('NOW()') |
|
156 | - ], |
|
157 | - [ |
|
158 | - 'name' => 'find', |
|
159 | - 'model' => 'groups', |
|
160 | - 'created_at' => \DB::raw('NOW()'), |
|
161 | - 'updated_at' => \DB::raw('NOW()') |
|
162 | - ], |
|
163 | - [ |
|
164 | - 'name' => 'search', |
|
165 | - 'model' => 'groups', |
|
166 | - 'created_at' => \DB::raw('NOW()'), |
|
167 | - 'updated_at' => \DB::raw('NOW()') |
|
168 | - ], |
|
169 | - [ |
|
170 | - 'name' => 'list', |
|
171 | - 'model' => 'groups', |
|
172 | - 'created_at' => \DB::raw('NOW()'), |
|
173 | - 'updated_at' => \DB::raw('NOW()') |
|
174 | - ], |
|
175 | - [ |
|
176 | - 'name' => 'findby', |
|
177 | - 'model' => 'groups', |
|
178 | - 'created_at' => \DB::raw('NOW()'), |
|
179 | - 'updated_at' => \DB::raw('NOW()') |
|
180 | - ], |
|
181 | - [ |
|
182 | - 'name' => 'first', |
|
183 | - 'model' => 'groups', |
|
184 | - 'created_at' => \DB::raw('NOW()'), |
|
185 | - 'updated_at' => \DB::raw('NOW()') |
|
186 | - ], |
|
187 | - [ |
|
188 | - 'name' => 'paginate', |
|
189 | - 'model' => 'groups', |
|
190 | - 'created_at' => \DB::raw('NOW()'), |
|
191 | - 'updated_at' => \DB::raw('NOW()') |
|
192 | - ], |
|
193 | - [ |
|
194 | - 'name' => 'paginateby', |
|
195 | - 'model' => 'groups', |
|
196 | - 'created_at' => \DB::raw('NOW()'), |
|
197 | - 'updated_at' => \DB::raw('NOW()') |
|
198 | - ], |
|
199 | - [ |
|
200 | - 'name' => 'assignpermissions', |
|
201 | - 'model' => 'groups', |
|
202 | - 'created_at' => \DB::raw('NOW()'), |
|
203 | - 'updated_at' => \DB::raw('NOW()') |
|
204 | - ], |
|
205 | - [ |
|
206 | - 'name' => 'users', |
|
207 | - 'model' => 'groups', |
|
208 | - 'created_at' => \DB::raw('NOW()'), |
|
209 | - 'updated_at' => \DB::raw('NOW()') |
|
210 | - ], |
|
211 | - ] |
|
212 | - ); |
|
142 | + /** |
|
143 | + * Groups model permissions. |
|
144 | + */ |
|
145 | + [ |
|
146 | + 'name' => 'save', |
|
147 | + 'model' => 'groups', |
|
148 | + 'created_at' => \DB::raw('NOW()'), |
|
149 | + 'updated_at' => \DB::raw('NOW()') |
|
150 | + ], |
|
151 | + [ |
|
152 | + 'name' => 'delete', |
|
153 | + 'model' => 'groups', |
|
154 | + 'created_at' => \DB::raw('NOW()'), |
|
155 | + 'updated_at' => \DB::raw('NOW()') |
|
156 | + ], |
|
157 | + [ |
|
158 | + 'name' => 'find', |
|
159 | + 'model' => 'groups', |
|
160 | + 'created_at' => \DB::raw('NOW()'), |
|
161 | + 'updated_at' => \DB::raw('NOW()') |
|
162 | + ], |
|
163 | + [ |
|
164 | + 'name' => 'search', |
|
165 | + 'model' => 'groups', |
|
166 | + 'created_at' => \DB::raw('NOW()'), |
|
167 | + 'updated_at' => \DB::raw('NOW()') |
|
168 | + ], |
|
169 | + [ |
|
170 | + 'name' => 'list', |
|
171 | + 'model' => 'groups', |
|
172 | + 'created_at' => \DB::raw('NOW()'), |
|
173 | + 'updated_at' => \DB::raw('NOW()') |
|
174 | + ], |
|
175 | + [ |
|
176 | + 'name' => 'findby', |
|
177 | + 'model' => 'groups', |
|
178 | + 'created_at' => \DB::raw('NOW()'), |
|
179 | + 'updated_at' => \DB::raw('NOW()') |
|
180 | + ], |
|
181 | + [ |
|
182 | + 'name' => 'first', |
|
183 | + 'model' => 'groups', |
|
184 | + 'created_at' => \DB::raw('NOW()'), |
|
185 | + 'updated_at' => \DB::raw('NOW()') |
|
186 | + ], |
|
187 | + [ |
|
188 | + 'name' => 'paginate', |
|
189 | + 'model' => 'groups', |
|
190 | + 'created_at' => \DB::raw('NOW()'), |
|
191 | + 'updated_at' => \DB::raw('NOW()') |
|
192 | + ], |
|
193 | + [ |
|
194 | + 'name' => 'paginateby', |
|
195 | + 'model' => 'groups', |
|
196 | + 'created_at' => \DB::raw('NOW()'), |
|
197 | + 'updated_at' => \DB::raw('NOW()') |
|
198 | + ], |
|
199 | + [ |
|
200 | + 'name' => 'assignpermissions', |
|
201 | + 'model' => 'groups', |
|
202 | + 'created_at' => \DB::raw('NOW()'), |
|
203 | + 'updated_at' => \DB::raw('NOW()') |
|
204 | + ], |
|
205 | + [ |
|
206 | + 'name' => 'users', |
|
207 | + 'model' => 'groups', |
|
208 | + 'created_at' => \DB::raw('NOW()'), |
|
209 | + 'updated_at' => \DB::raw('NOW()') |
|
210 | + ], |
|
211 | + ] |
|
212 | + ); |
|
213 | 213 | |
214 | 214 | /** |
215 | 215 | * Delete previous data. |
@@ -237,29 +237,29 @@ discard block |
||
237 | 237 | * Create Default users. |
238 | 238 | */ |
239 | 239 | $adminUserId = DB::table('users')->insertGetId( |
240 | - [ |
|
240 | + [ |
|
241 | 241 | 'email' => '[email protected]', |
242 | 242 | 'password' => bcrypt('123456'), |
243 | 243 | 'created_at' => \DB::raw('NOW()'), |
244 | 244 | 'updated_at' => \DB::raw('NOW()') |
245 | 245 | ] |
246 | - ); |
|
246 | + ); |
|
247 | 247 | |
248 | 248 | /** |
249 | 249 | * Assign users to groups. |
250 | 250 | */ |
251 | 251 | DB::table('users_groups')->insert( |
252 | - [ |
|
253 | - [ |
|
252 | + [ |
|
253 | + [ |
|
254 | 254 | 'user_id' => $adminUserId, |
255 | 255 | 'group_id' => $adminGroupId, |
256 | 256 | 'created_at' => \DB::raw('NOW()'), |
257 | 257 | 'updated_at' => \DB::raw('NOW()') |
258 | - ] |
|
259 | - ] |
|
260 | - ); |
|
258 | + ] |
|
259 | + ] |
|
260 | + ); |
|
261 | 261 | |
262 | - /** |
|
262 | + /** |
|
263 | 263 | * Assign the permissions to the admin group. |
264 | 264 | */ |
265 | 265 | $permissionIds = DB::table('permissions')->whereIn('model', ['users', 'permissions', 'groups'])->select('id')->lists('id'); |
@@ -13,15 +13,15 @@ |
||
13 | 13 | public function up() |
14 | 14 | { |
15 | 15 | Schema::create('users', function (Blueprint $table) { |
16 | - $table->increments('id'); |
|
17 | - $table->string('name',100); |
|
18 | - $table->string('email')->unique(); |
|
19 | - $table->string('password', 60); |
|
20 | - $table->boolean('blocked', 0); |
|
21 | - $table->softDeletes(); |
|
22 | - $table->rememberToken(); |
|
23 | - $table->timestamps(); |
|
24 | - }); |
|
16 | + $table->increments('id'); |
|
17 | + $table->string('name',100); |
|
18 | + $table->string('email')->unique(); |
|
19 | + $table->string('password', 60); |
|
20 | + $table->boolean('blocked', 0); |
|
21 | + $table->softDeletes(); |
|
22 | + $table->rememberToken(); |
|
23 | + $table->timestamps(); |
|
24 | + }); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -12,9 +12,9 @@ |
||
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 | - $table->string('name',100); |
|
17 | + $table->string('name', 100); |
|
18 | 18 | $table->string('email')->unique(); |
19 | 19 | $table->string('password', 60); |
20 | 20 | $table->boolean('blocked', 0); |
@@ -2,22 +2,22 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /** |
|
6 | - * List of error messages used in core module. |
|
7 | - */ |
|
8 | - 'unAuthorized' => 'من فضلك قم بتسجيل الدخول', |
|
9 | - 'tokenExpired' => 'انتهت صلاحية الدخول', |
|
10 | - 'noPermissions' => 'لا توجد صلاحية', |
|
11 | - 'loginFailed' => 'خطأ في البريد لاكتروني او كلمة المرور', |
|
12 | - 'redisNotRunning' => 'سيرفير الاشعارات لايعمل', |
|
13 | - 'dbQueryError' => 'خطا في البيانات', |
|
14 | - 'cannotCreateSetting' => 'لا يمكن اضافة اعدادات', |
|
15 | - 'cannotUpdateSettingKey' => 'لا يمكن تعديل اعدادات', |
|
16 | - 'userIsBlocked' => 'لقد تم حظرك', |
|
17 | - 'invalidResetToken' => 'رمز تعديل كلمة المرور خطا', |
|
18 | - 'invalidResetPassword' => 'خطا في نعديل كلمة المرور', |
|
19 | - 'invalidOldPassword' => 'كلمة السر القديمه خطا', |
|
20 | - 'notFound' => 'ال :replace المطلوب غير موجود', |
|
21 | - 'generalError' => 'حدث خطا ما', |
|
5 | + /** |
|
6 | + * List of error messages used in core module. |
|
7 | + */ |
|
8 | + 'unAuthorized' => 'من فضلك قم بتسجيل الدخول', |
|
9 | + 'tokenExpired' => 'انتهت صلاحية الدخول', |
|
10 | + 'noPermissions' => 'لا توجد صلاحية', |
|
11 | + 'loginFailed' => 'خطأ في البريد لاكتروني او كلمة المرور', |
|
12 | + 'redisNotRunning' => 'سيرفير الاشعارات لايعمل', |
|
13 | + 'dbQueryError' => 'خطا في البيانات', |
|
14 | + 'cannotCreateSetting' => 'لا يمكن اضافة اعدادات', |
|
15 | + 'cannotUpdateSettingKey' => 'لا يمكن تعديل اعدادات', |
|
16 | + 'userIsBlocked' => 'لقد تم حظرك', |
|
17 | + 'invalidResetToken' => 'رمز تعديل كلمة المرور خطا', |
|
18 | + 'invalidResetPassword' => 'خطا في نعديل كلمة المرور', |
|
19 | + 'invalidOldPassword' => 'كلمة السر القديمه خطا', |
|
20 | + 'notFound' => 'ال :replace المطلوب غير موجود', |
|
21 | + 'generalError' => 'حدث خطا ما', |
|
22 | 22 | |
23 | 23 | ]; |
24 | 24 | \ No newline at end of file |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /* |
|
5 | + /* |
|
6 | 6 | |-------------------------------------------------------------------------- |
7 | 7 | | Authentication Language Lines |
8 | 8 | |-------------------------------------------------------------------------- |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | - 'failed' => 'These credentials do not match our records.', |
|
17 | - 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', |
|
16 | + 'failed' => 'These credentials do not match our records.', |
|
17 | + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', |
|
18 | 18 | |
19 | 19 | ]; |