You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The $fillable array defines what columns in a model can be filled trough mass assignment.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Flight extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name'];
}
Uhh... I don't know if it is possible, but I can try. Could you please create another issue for that? Just fill title and put a reference to your previous comment.
The
$fillable
array defines what columns in a model can be filled trough mass assignment.It'd allow us to use this function:
$flight = App\Flight::create(['name' => 'Flight 10']);
Or this one if the model is already defined:
$flight->fill(['name' => 'Flight 22']);
Could you add inspection for this array, and maybe typehint the expected type on the
fill
andcreate
methods based on annotated column type?Thanks!
The text was updated successfully, but these errors were encountered: