I have strange issue while using create or update methods on laravel tinker although i added $fillable array
table fields as follows
- id
- title
- body
- published_at
- timestamps
model as follows
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
protected $fillable = ['title','body'];
}
command line i typed
$article = App\Article::create(['title' => 'ready']);
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire