for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace GarbuzIvan\LaravelGeneratorPackage\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Dict extends Model
{
use HasFactory;
protected $table = 'lgp_dict';
/**
* @var array
*/
protected $fillable = [
'name',
];
* The attributes that should be hidden for arrays.
*
protected $hidden = [];
* The attributes that should be casted to native types.
protected $casts = [
'id' => 'integer',
'name' => 'string',
* Validation rules
public static $rules = [
'name' => 'required',
* List option for dict
* @return hasMany
public function options(): hasMany
return $this->hasMany(DictOption::class, 'dict_id', 'id');
}