skip to Main Content

Laravel route model binding for model with uuid does not instantiate model

I've run out of ideas so I thought I'll ask around - here's my code: # app/Map/MapServiceProvider.php class MapServiceProvider extends ServiceProvider { /** * Bootstrap any package services. */ public function boot(): void { Route::model('map_marker', Marker::class); $this->loadMigrationsFrom(__DIR__.'/Migrations'); $this->loadRoutesFrom(__DIR__.'/routes.php'); } //…

VIEW QUESTION

Cant return $couponDetails->couponName; value in laravel

$couponCode = $request->couponCode; // Get coupon details by coupon code $coupon = Coupon::where('couponCode', $couponCode) ->get() ->first(); $couponDetails = response()->json($coupon); return $couponDetails->couponName; That returns as: Undefined property: IlluminateHttpJsonResponse::$couponName (500 Internal Server Error) I am tring to get couponName value from couponDetails

VIEW QUESTION
Back To Top
Search