lundi 23 mai 2016

Reserved column names in Eloquent

From a cursory look into Illuminate\Database\Eloquent\Model I can see the following instance attributes:

protected $connection
protected $table
protected $primaryKey
protected $perPage
public    $incrementing
public    $timestamps
protected $attributes
protected $original
protected $relations
protected $hidden
protected $visible
protected $appends
protected $fillable
protected $guarded
protected $dates
protected $dateFormat
protected $casts
protected $touches
protected $observables
protected $with
protected $morphClass
public    $exists
public    $wasRecentlyCreated

Questions:

  • Why are these things not static, seeing as they are class-level configuration stuff?
  • Does it mean I cannot use these names for my table columns?
  • Is there an official list of names one cannot use as table columns?
  • What if I have a legacy table with columns named like this?
  • Who came up with this genius idea?


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

Aucun commentaire:

Enregistrer un commentaire