Cleaning #1
| @@ -1,5 +1,7 @@ | |||||||
| <?php | <?php | ||||||
|  |  | ||||||
|  | declare(strict_types=1); | ||||||
|  |  | ||||||
| namespace App\Models; | namespace App\Models; | ||||||
|  |  | ||||||
| use Illuminate\Database\Eloquent\Builder; | use Illuminate\Database\Eloquent\Builder; | ||||||
| @@ -14,7 +16,6 @@ use Illuminate\Database\Eloquent\Model; | |||||||
|  */ |  */ | ||||||
| class Category extends Model | class Category extends Model | ||||||
| { | { | ||||||
|     // use HasFactory; |  | ||||||
|  |  | ||||||
|     protected $guarded = []; |     protected $guarded = []; | ||||||
|     protected $casts = [ |     protected $casts = [ | ||||||
| @@ -26,7 +27,7 @@ class Category extends Model | |||||||
|         'visible' => 'boolean' |         'visible' => 'boolean' | ||||||
|     ]; |     ]; | ||||||
|  |  | ||||||
|     public function scopeVisibled(Builder $builder) |     public function scopeVisibled(Builder $builder): Builder | ||||||
|     { |     { | ||||||
|         return $builder->where(function (Builder $query) { |         return $builder->where(function (Builder $query) { | ||||||
|             $query->where('visible', true) |             $query->where('visible', true) | ||||||
|   | |||||||
| @@ -23,10 +23,7 @@ use Illuminate\Database\Eloquent\Builder; | |||||||
| class Project extends Model | class Project extends Model | ||||||
| { | { | ||||||
|  |  | ||||||
|     // use HasFactory; |  | ||||||
|  |  | ||||||
|     protected $dateFormat = 'Y-m-d'; |     protected $dateFormat = 'Y-m-d'; | ||||||
|  |  | ||||||
|     protected $guarded = []; |     protected $guarded = []; | ||||||
|     protected $casts = [ |     protected $casts = [ | ||||||
|         'id' => 'integer', |         'id' => 'integer', | ||||||
| @@ -65,7 +62,7 @@ class Project extends Model | |||||||
|             $this->attributes['update_date'] = null; |             $this->attributes['update_date'] = null; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public function scopeVisibled(Builder $builder) |     public function scopeVisibled(Builder $builder): Builder | ||||||
|     { |     { | ||||||
|         return $builder->where('visible', true); |         return $builder->where('visible', true); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -1,5 +1,7 @@ | |||||||
| <?php | <?php | ||||||
|  |  | ||||||
|  | declare(strict_types=1); | ||||||
|  |  | ||||||
| namespace App\Models; | namespace App\Models; | ||||||
|  |  | ||||||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | use Illuminate\Database\Eloquent\Factories\HasFactory; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user