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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/28W7QEr
via IFTTT

Aucun commentaire:

Enregistrer un commentaire