@@ -1,6 +1,5 @@ |
||
1 | 1 | <?php namespace App\Modules\Acl; |
2 | 2 | |
3 | -use Illuminate\Database\Eloquent\Model; |
|
4 | 3 | use App\User; |
5 | 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
6 | 5 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use SoftDeletes; |
10 | 10 | protected $table = 'users'; |
11 | 11 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
12 | - protected $hidden = ['password', 'remember_token','deleted_at']; |
|
12 | + protected $hidden = ['password', 'remember_token', 'deleted_at']; |
|
13 | 13 | protected $guarded = ['id']; |
14 | 14 | protected $fillable = ['name', 'email', 'password']; |
15 | 15 | public $searchable = ['name', 'email']; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | public function groups() |
49 | 49 | { |
50 | - return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
50 | + return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup', 'users_groups', 'user_id', 'group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public static function boot() |
@@ -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 | ]; |