Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
伙计,这越来越令人沮丧!
在 Laravel 4 中,使用 Eloquent 可以var_dump(Worker::find(1));:但是,如果我尝试使用to_array(),它就会崩溃:var_dump(Worker::find(1)->to_array());. 这会引发以下异常:
var_dump(Worker::find(1));
to_array()
var_dump(Worker::find(1)->to_array());
call_user_func_array() 期望参数 1 是一个有效的回调,类 'Illuminate\Database\Query\Builder' 没有方法 'to_array'
Laravel 4 中的方法现在是 camelCased
var_dump(Worker::find(1)->toArray());