Man, this is getting frustrating!
In Laravel 4, using Eloquent, this works: var_dump(Worker::find(1));
. But if I try to use to_array()
, it falls apart: var_dump(Worker::find(1)->to_array());
. This throws the following exception:
call_user_func_array() expects parameter 1 to be a valid callback, class 'Illuminate\Database\Query\Builder' does not have a method 'to_array'
Method in Laravel 4 are now camelCased
var_dump(Worker::find(1)->toArray());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With