make 2 models user and wishlist with fillable than casting code example
Example: make 2 models user and wishlist with fillable than casting
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class user extends Model
{
use HasFactory;
protected $table = 'user';
protected $fillable = [
'name',
'email',
'password',
'active',
'role',
];
protected $casts = [
'name'=> 'string',
'email'=> '',
'password'=> '',
'active'=> 'boolean',
'role'=> '',
];
}