skip to Main Content

Laravel: 'Get' Route not calling method in controller

I have a route as: Route::get('/edit/detail/{modelName}/{rowId}/{persId}',[AddPersInfoController::class,'editPersDetailTabs'])->name('edit_pers_detail'); and I'm calling it from a button in a table as: Edit: This is the actual code on my page. <td><a href="{{ route('edit_pers_detail',['Posting_history', $posting->id, $posting->pers_info_id] ) }}"> <button class="btn btn-icon btn-primary"> <i class="demo-pli-pencil fs-5"></i>…

VIEW QUESTION

Laravel Namespace Resource Controller Routing

I was working on a laravel project. The following is the code of my UserController: <?php namespace AppHttpControllersBackendAdminUsers; use AppModelsUser; use IlluminateHttpRequest; use SpatiePermissionModelsRole; use AppHttpControllersController; use IlluminateSupportFacadesSession; use AppRepositoriesInterfacesUserRepositoryInterface; class UserController extends Controller { protected $userRepository; public function __construct(UserRepositoryInterface…

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

I cannot delete data which have many-to-many relationship in laravel 9 – PHP

I am using PHP 8.2.0, MySQL 8.2.0, and Laravel 9.48.0. This is my database migrations file pivot table (category_menu): public function up() { Schema::create('category_menu', function (Blueprint $table) { $table->foreignId('category_id')->constrained(); $table->foreignId('menu_id')->constrained(); }); } This is the CategoryController.php: public function destroy(Category $category)…

VIEW QUESTION
Back To Top
Search