2017-05-11

Laravel Gotchas

Frameworks behave nicely as long as their special needs are met.

Laravel (5.4) assumes that your `id` table column is of an integer type if it is the primary key. When you collect its value, Eloquent model will cast it to an integer, changing, for example, 'Wbc' to 0.

The solution is not too bad, you just override the Model's property:
public $incrementing = false;


Nav komentāru:

Ierakstīt komentāru