Skip to content
Discussion options

You must be logged in to vote
class Post extends Model
{
    use HasFactory;

    public $id;
    public $text;
    public $created_at;
    public $updated_at;

    protected $fillable = [
        'id',
        'text',
        'created_at',
        'updated_at'
    ];
}

There no reason to define the following property. It's not part of any Eloquent conversion and the root cause of your issue:

    public $id;
    public $text;
    public $created_at;
    public $updated_at;

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@robstarkdev
Comment options

@robstarkdev
Comment options

Answer selected by robstarkdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants