I would like to know if it's possible to return a MySQL stored procedure call as an eloquent object.
The below call works fine for me, but $result
always returns an array instead of the usual Eloquent object.
$result = DB::select('call bookings_by_voucher()');
Does anyone know how to return this as an object, so that I can use ->count()
, ->get()
etc.
You must pass the array into a new instance of your eloquent object.
$booking = new Booking($result);
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