@@ -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 | } |
@@ -6,62 +6,62 @@ |
||
| 6 | 6 | class AclUserObserver |
| 7 | 7 | { |
| 8 | 8 | |
| 9 | - public function saving($model) |
|
| 10 | - { |
|
| 11 | - if ($model->isDirty('profile_picture')) { |
|
| 12 | - \Media::deleteImage($model->getOriginal('profile_picture')); |
|
| 13 | - } |
|
| 14 | - } |
|
| 9 | + public function saving($model) |
|
| 10 | + { |
|
| 11 | + if ($model->isDirty('profile_picture')) { |
|
| 12 | + \Media::deleteImage($model->getOriginal('profile_picture')); |
|
| 13 | + } |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - public function saved($model) |
|
| 17 | - { |
|
| 18 | - // |
|
| 19 | - } |
|
| 16 | + public function saved($model) |
|
| 17 | + { |
|
| 18 | + // |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - public function creating($model) |
|
| 22 | - { |
|
| 23 | - // |
|
| 24 | - } |
|
| 21 | + public function creating($model) |
|
| 22 | + { |
|
| 23 | + // |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public function created($model) |
|
| 27 | - { |
|
| 28 | - // |
|
| 29 | - } |
|
| 26 | + public function created($model) |
|
| 27 | + { |
|
| 28 | + // |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - public function updating($model) |
|
| 32 | - { |
|
| 33 | - // |
|
| 34 | - } |
|
| 31 | + public function updating($model) |
|
| 32 | + { |
|
| 33 | + // |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - public function updated($model) |
|
| 37 | - { |
|
| 38 | - if ($model->isDirty('blocked') && $model->blocked) { |
|
| 39 | - $model->tokens()->each(function ($token) { |
|
| 36 | + public function updated($model) |
|
| 37 | + { |
|
| 38 | + if ($model->isDirty('blocked') && $model->blocked) { |
|
| 39 | + $model->tokens()->each(function ($token) { |
|
| 40 | 40 | |
| 41 | - \Core::users()->revokeAccessToken($token); |
|
| 42 | - }); |
|
| 43 | - } |
|
| 44 | - } |
|
| 41 | + \Core::users()->revokeAccessToken($token); |
|
| 42 | + }); |
|
| 43 | + } |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public function deleting($model) |
|
| 47 | - { |
|
| 48 | - if ($model->getOriginal('id') == \Auth::id()) { |
|
| 49 | - \ErrorHandler::noPermissions(); |
|
| 50 | - } |
|
| 51 | - } |
|
| 46 | + public function deleting($model) |
|
| 47 | + { |
|
| 48 | + if ($model->getOriginal('id') == \Auth::id()) { |
|
| 49 | + \ErrorHandler::noPermissions(); |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - public function deleted($model) |
|
| 54 | - { |
|
| 55 | - // |
|
| 56 | - } |
|
| 53 | + public function deleted($model) |
|
| 54 | + { |
|
| 55 | + // |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - public function restoring($model) |
|
| 59 | - { |
|
| 60 | - // |
|
| 61 | - } |
|
| 58 | + public function restoring($model) |
|
| 59 | + { |
|
| 60 | + // |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - public function restored($model) |
|
| 64 | - { |
|
| 65 | - // |
|
| 66 | - } |
|
| 63 | + public function restored($model) |
|
| 64 | + { |
|
| 65 | + // |
|
| 66 | + } |
|
| 67 | 67 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | public function updated($model) |
| 37 | 37 | { |
| 38 | 38 | if ($model->isDirty('blocked') && $model->blocked) { |
| 39 | - $model->tokens()->each(function ($token) { |
|
| 39 | + $model->tokens()->each(function($token) { |
|
| 40 | 40 | |
| 41 | 41 | \Core::users()->revokeAccessToken($token); |
| 42 | 42 | }); |
@@ -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,37 +6,37 @@ |
||
| 6 | 6 | class AclPermission extends Model |
| 7 | 7 | { |
| 8 | 8 | |
| 9 | - use SoftDeletes; |
|
| 10 | - protected $table = 'permissions'; |
|
| 11 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 12 | - protected $hidden = ['deleted_at']; |
|
| 13 | - protected $guarded = ['id']; |
|
| 14 | - protected $fillable = ['name', 'model']; |
|
| 15 | - public $searchable = ['name', 'model']; |
|
| 9 | + use SoftDeletes; |
|
| 10 | + protected $table = 'permissions'; |
|
| 11 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 12 | + protected $hidden = ['deleted_at']; |
|
| 13 | + protected $guarded = ['id']; |
|
| 14 | + protected $fillable = ['name', 'model']; |
|
| 15 | + public $searchable = ['name', 'model']; |
|
| 16 | 16 | |
| 17 | - public function getCreatedAtAttribute($value) |
|
| 18 | - { |
|
| 19 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 20 | - } |
|
| 17 | + public function getCreatedAtAttribute($value) |
|
| 18 | + { |
|
| 19 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - public function getUpdatedAtAttribute($value) |
|
| 23 | - { |
|
| 24 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 25 | - } |
|
| 22 | + public function getUpdatedAtAttribute($value) |
|
| 23 | + { |
|
| 24 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - public function getDeletedAtAttribute($value) |
|
| 28 | - { |
|
| 29 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 30 | - } |
|
| 27 | + public function getDeletedAtAttribute($value) |
|
| 28 | + { |
|
| 29 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - public function groups() |
|
| 33 | - { |
|
| 34 | - return $this->belongsToMany('\App\Modules\Acl\AclGroup', 'groups_permissions', 'permission_id', 'group_id')->whereNull('groups_permissions.deleted_at')->withTimestamps(); |
|
| 35 | - } |
|
| 32 | + public function groups() |
|
| 33 | + { |
|
| 34 | + return $this->belongsToMany('\App\Modules\Acl\AclGroup', 'groups_permissions', 'permission_id', 'group_id')->whereNull('groups_permissions.deleted_at')->withTimestamps(); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - public static function boot() |
|
| 38 | - { |
|
| 39 | - parent::boot(); |
|
| 40 | - AclPermission::observe(\App::make('App\Modules\Acl\ModelObservers\AclPermissionObserver')); |
|
| 41 | - } |
|
| 37 | + public static function boot() |
|
| 38 | + { |
|
| 39 | + parent::boot(); |
|
| 40 | + AclPermission::observe(\App::make('App\Modules\Acl\ModelObservers\AclPermissionObserver')); |
|
| 41 | + } |
|
| 42 | 42 | } |
@@ -4,13 +4,13 @@ |
||
| 4 | 4 | |
| 5 | 5 | class PermissionRepository extends AbstractRepository |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * Return the model full namespace. |
|
| 9 | - * |
|
| 10 | - * @return string |
|
| 11 | - */ |
|
| 12 | - protected function getModel() |
|
| 13 | - { |
|
| 14 | - return 'App\Modules\Acl\AclPermission'; |
|
| 15 | - } |
|
| 7 | + /** |
|
| 8 | + * Return the model full namespace. |
|
| 9 | + * |
|
| 10 | + * @return string |
|
| 11 | + */ |
|
| 12 | + protected function getModel() |
|
| 13 | + { |
|
| 14 | + return 'App\Modules\Acl\AclPermission'; |
|
| 15 | + } |
|
| 16 | 16 | } |
@@ -4,31 +4,31 @@ |
||
| 4 | 4 | |
| 5 | 5 | class GroupRepository extends AbstractRepository |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * Return the model full namespace. |
|
| 9 | - * |
|
| 10 | - * @return string |
|
| 11 | - */ |
|
| 12 | - protected function getModel() |
|
| 13 | - { |
|
| 14 | - return 'App\Modules\Acl\AclGroup'; |
|
| 15 | - } |
|
| 7 | + /** |
|
| 8 | + * Return the model full namespace. |
|
| 9 | + * |
|
| 10 | + * @return string |
|
| 11 | + */ |
|
| 12 | + protected function getModel() |
|
| 13 | + { |
|
| 14 | + return 'App\Modules\Acl\AclGroup'; |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Assign the given permission ids to the given group. |
|
| 19 | - * |
|
| 20 | - * @param integer $groupId |
|
| 21 | - * @param array $permissionIds |
|
| 22 | - * @return object |
|
| 23 | - */ |
|
| 24 | - public function assignPermissions($groupId, $permissionIds) |
|
| 25 | - { |
|
| 26 | - \DB::transaction(function () use ($groupId, $permissionIds) { |
|
| 27 | - $group = $this->find($groupId); |
|
| 28 | - $group->permissions()->detach(); |
|
| 29 | - $group->permissions()->attach($permissionIds); |
|
| 30 | - }); |
|
| 17 | + /** |
|
| 18 | + * Assign the given permission ids to the given group. |
|
| 19 | + * |
|
| 20 | + * @param integer $groupId |
|
| 21 | + * @param array $permissionIds |
|
| 22 | + * @return object |
|
| 23 | + */ |
|
| 24 | + public function assignPermissions($groupId, $permissionIds) |
|
| 25 | + { |
|
| 26 | + \DB::transaction(function () use ($groupId, $permissionIds) { |
|
| 27 | + $group = $this->find($groupId); |
|
| 28 | + $group->permissions()->detach(); |
|
| 29 | + $group->permissions()->attach($permissionIds); |
|
| 30 | + }); |
|
| 31 | 31 | |
| 32 | - return $this->find($groupId); |
|
| 33 | - } |
|
| 32 | + return $this->find($groupId); |
|
| 33 | + } |
|
| 34 | 34 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function assignPermissions($groupId, $permissionIds) |
| 25 | 25 | { |
| 26 | - \DB::transaction(function () use ($groupId, $permissionIds) { |
|
| 26 | + \DB::transaction(function() use ($groupId, $permissionIds) { |
|
| 27 | 27 | $group = $this->find($groupId); |
| 28 | 28 | $group->permissions()->detach(); |
| 29 | 29 | $group->permissions()->attach($permissionIds); |
@@ -4,37 +4,37 @@ |
||
| 4 | 4 | |
| 5 | 5 | class OauthClientRepository extends AbstractRepository |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * Return the model full namespace. |
|
| 9 | - * |
|
| 10 | - * @return string |
|
| 11 | - */ |
|
| 12 | - protected function getModel() |
|
| 13 | - { |
|
| 14 | - return 'App\Modules\Acl\OauthClient'; |
|
| 15 | - } |
|
| 7 | + /** |
|
| 8 | + * Return the model full namespace. |
|
| 9 | + * |
|
| 10 | + * @return string |
|
| 11 | + */ |
|
| 12 | + protected function getModel() |
|
| 13 | + { |
|
| 14 | + return 'App\Modules\Acl\OauthClient'; |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Revoke the given client. |
|
| 19 | - * |
|
| 20 | - * @param integer $clientId |
|
| 21 | - * @return void |
|
| 22 | - */ |
|
| 23 | - public function revoke($clientId) |
|
| 24 | - { |
|
| 25 | - $client = $this->find($clientId); |
|
| 26 | - $client->tokens()->update(['revoked' => true]); |
|
| 27 | - $this->save(['id'=> $clientId, 'revoked' => true]); |
|
| 28 | - } |
|
| 17 | + /** |
|
| 18 | + * Revoke the given client. |
|
| 19 | + * |
|
| 20 | + * @param integer $clientId |
|
| 21 | + * @return void |
|
| 22 | + */ |
|
| 23 | + public function revoke($clientId) |
|
| 24 | + { |
|
| 25 | + $client = $this->find($clientId); |
|
| 26 | + $client->tokens()->update(['revoked' => true]); |
|
| 27 | + $this->save(['id'=> $clientId, 'revoked' => true]); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Un revoke the given client. |
|
| 32 | - * |
|
| 33 | - * @param integer $clientId |
|
| 34 | - * @return void |
|
| 35 | - */ |
|
| 36 | - public function unRevoke($clientId) |
|
| 37 | - { |
|
| 38 | - $this->save(['id'=> $clientId, 'revoked' => false]); |
|
| 39 | - } |
|
| 30 | + /** |
|
| 31 | + * Un revoke the given client. |
|
| 32 | + * |
|
| 33 | + * @param integer $clientId |
|
| 34 | + * @return void |
|
| 35 | + */ |
|
| 36 | + public function unRevoke($clientId) |
|
| 37 | + { |
|
| 38 | + $this->save(['id'=> $clientId, 'revoked' => false]); |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $factory->define(App\Modules\Core\Settings::class, function (Faker\Generator $faker) { |
| 4 | - return [ |
|
| 5 | - 'name' => $faker->randomElement(['Company Name', 'Title', 'Header Image']), |
|
| 6 | - 'value' => $faker->word(), |
|
| 7 | - 'key' => $faker->word(), |
|
| 8 | - 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
|
| 9 | - 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
|
| 10 | - ]; |
|
| 4 | + return [ |
|
| 5 | + 'name' => $faker->randomElement(['Company Name', 'Title', 'Header Image']), |
|
| 6 | + 'value' => $faker->word(), |
|
| 7 | + 'key' => $faker->word(), |
|
| 8 | + 'created_at' => $faker->dateTimeBetween('-1 years', 'now'), |
|
| 9 | + 'updated_at' => $faker->dateTimeBetween('-1 years', 'now') |
|
| 10 | + ]; |
|
| 11 | 11 | }); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$factory->define(App\Modules\Core\Settings::class, function (Faker\Generator $faker) { |
|
| 3 | +$factory->define(App\Modules\Core\Settings::class, function(Faker\Generator $faker) { |
|
| 4 | 4 | return [ |
| 5 | 5 | 'name' => $faker->randomElement(['Company Name', 'Title', 'Header Image']), |
| 6 | 6 | 'value' => $faker->word(), |
@@ -5,30 +5,30 @@ |
||
| 5 | 5 | |
| 6 | 6 | class Settings extends Migration |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Run the migrations. |
|
| 10 | - * |
|
| 11 | - * @return void |
|
| 12 | - */ |
|
| 13 | - public function up() |
|
| 14 | - { |
|
| 15 | - Schema::create('settings', function (Blueprint $table) { |
|
| 16 | - $table->increments('id'); |
|
| 17 | - $table->string('name', 100); |
|
| 18 | - $table->string('key', 100)->unique(); |
|
| 19 | - $table->text('value')->nullable(); |
|
| 20 | - $table->softDeletes(); |
|
| 21 | - $table->timestamps(); |
|
| 22 | - }); |
|
| 23 | - } |
|
| 8 | + /** |
|
| 9 | + * Run the migrations. |
|
| 10 | + * |
|
| 11 | + * @return void |
|
| 12 | + */ |
|
| 13 | + public function up() |
|
| 14 | + { |
|
| 15 | + Schema::create('settings', function (Blueprint $table) { |
|
| 16 | + $table->increments('id'); |
|
| 17 | + $table->string('name', 100); |
|
| 18 | + $table->string('key', 100)->unique(); |
|
| 19 | + $table->text('value')->nullable(); |
|
| 20 | + $table->softDeletes(); |
|
| 21 | + $table->timestamps(); |
|
| 22 | + }); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Reverse the migrations. |
|
| 27 | - * |
|
| 28 | - * @return void |
|
| 29 | - */ |
|
| 30 | - public function down() |
|
| 31 | - { |
|
| 32 | - Schema::dropIfExists('settings'); |
|
| 33 | - } |
|
| 25 | + /** |
|
| 26 | + * Reverse the migrations. |
|
| 27 | + * |
|
| 28 | + * @return void |
|
| 29 | + */ |
|
| 30 | + public function down() |
|
| 31 | + { |
|
| 32 | + Schema::dropIfExists('settings'); |
|
| 33 | + } |
|
| 34 | 34 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('settings', function (Blueprint $table) { |
|
| 15 | + Schema::create('settings', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->string('name', 100); |
| 18 | 18 | $table->string('key', 100)->unique(); |