@@ -5,7 +5,7 @@ |
||
5 | 5 | public function getConfig() |
6 | 6 | { |
7 | 7 | $customSettings = []; |
8 | - Settings::get(['key', 'value'])->each(function ($setting) use (&$customSettings){ |
|
8 | + Settings::get(['key', 'value'])->each(function($setting) use (&$customSettings){ |
|
9 | 9 | $customSettings[$setting['key']] = $setting['value']; |
10 | 10 | }); |
11 | 11 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
5 | 5 | |
6 | -class Log extends Model{ |
|
6 | +class Log extends Model { |
|
7 | 7 | |
8 | 8 | use SoftDeletes; |
9 | 9 | protected $table = 'logs'; |
@@ -12,11 +12,11 @@ |
||
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 | - $table->string('name',100); |
|
18 | - $table->string('key',100)->unique(); |
|
19 | - $table->string('value',100); |
|
17 | + $table->string('name', 100); |
|
18 | + $table->string('key', 100)->unique(); |
|
19 | + $table->string('value', 100); |
|
20 | 20 | $table->softDeletes(); |
21 | 21 | $table->timestamps(); |
22 | 22 | }); |
@@ -12,11 +12,11 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('logs', function (Blueprint $table) { |
|
15 | + Schema::create('logs', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | - $table->string('action',100); |
|
18 | - $table->string('item_name',100); |
|
19 | - $table->string('item_type',100); |
|
17 | + $table->string('action', 100); |
|
18 | + $table->string('item_name', 100); |
|
19 | + $table->string('item_type', 100); |
|
20 | 20 | $table->integer('item_id'); |
21 | 21 | $table->integer('user_id'); |
22 | 22 | $table->softDeletes(); |
@@ -3,14 +3,14 @@ |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
5 | 5 | |
6 | -class Settings extends Model{ |
|
6 | +class Settings extends Model { |
|
7 | 7 | |
8 | 8 | use SoftDeletes; |
9 | 9 | protected $table = 'settings'; |
10 | 10 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
11 | 11 | protected $hidden = ['deleted_at']; |
12 | 12 | protected $guarded = ['id', 'key']; |
13 | - protected $fillable = ['name','value']; |
|
13 | + protected $fillable = ['name', 'value']; |
|
14 | 14 | |
15 | 15 | public function getCreatedAtAttribute($value) |
16 | 16 | { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | foreach ($this->getRepoNameSpace() as $repoNameSpace) |
20 | 20 | { |
21 | - $class = rtrim($repoNameSpace, '\\') . '\\' . ucfirst(str_singular($name)) . 'Repository'; |
|
21 | + $class = rtrim($repoNameSpace, '\\').'\\'.ucfirst(str_singular($name)).'Repository'; |
|
22 | 22 | if (class_exists($class)) |
23 | 23 | { |
24 | 24 | return \App::make($class); |
@@ -12,5 +12,5 @@ |
||
12 | 12 | * to preform actions like (add, edit ... etc). |
13 | 13 | * @var string |
14 | 14 | */ |
15 | - protected $model = 'logs'; |
|
15 | + protected $model = 'logs'; |
|
16 | 16 | } |
@@ -13,14 +13,14 @@ |
||
13 | 13 | * to preform actions like (add, edit ... etc). |
14 | 14 | * @var string |
15 | 15 | */ |
16 | - protected $model = 'settings'; |
|
16 | + protected $model = 'settings'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * The validations rules used by the base api controller |
20 | 20 | * to check before add. |
21 | 21 | * @var array |
22 | 22 | */ |
23 | - protected $validationRules = [ |
|
23 | + protected $validationRules = [ |
|
24 | 24 | 'name' => 'required|string|max:100', |
25 | 25 | 'value' => 'required|string|max:100' |
26 | 26 | ]; |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $this->skipLoginCheck = property_exists($this, 'skipLoginCheck') ? $this->skipLoginCheck : []; |
48 | 48 | |
49 | 49 | $this->relations = array_key_exists($this->model, $this->config['relations']) ? $this->config['relations'][$this->model] : false; |
50 | - $route = explode('@',\Route::currentRouteAction())[1]; |
|
50 | + $route = explode('@', \Route::currentRouteAction())[1]; |
|
51 | 51 | $this->checkPermission(explode('_', snake_case($route))[1]); |
52 | 52 | } |
53 | 53 |