0
Saving:
var $newOs = new OS;
$newOs->date = date;
$newOs->name = name;
$newOs->Area = area;
$newOs->save();
Note that on the last line is the $newOS->save
, in which no parameters are passed. But in the documentation of the Illuminate Eloquent Model, it has the method save()
receiving parameters.
I suspect it’s something in constructor
, but I found nothing.
How this works by lowering the cloths if no parameter is passed in the function?
I couldn’t reproduce this with Object Orientation.
Either I didn’t know how to do it or it’s something Laravel’s maker did internally to make it happen.
The
Illuminate\Eloquent\Model
uses the TraitGuardsAttributes
, that one trait treats the attributes that were inserted directly into the object, as in your example. then it fetches all attributes and inserts into the methodsave()
. Right on top of that.– Erlon Charles
I think it’ll help: Documentation on Laravel Index
– Iago Moreira STV