dimanche 26 juin 2016

Laravel Eloquent create null field

class Product extends Model
{
    protected $fillable = ['name'];
    protected $connection = 'pos';

    public function __construct()
    {
        config(['database.connections.pos.database' => 'pos_1']);
    }
}

Product::create(['name' => 'Snack']);

When I check on my db, any new row, but name is null, why?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire