Laravel : BadMethodCallException Method [show] does not exist
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
Laravel Error Solved: Understanding BadMethodCallException Method [show] does not exist
As a senior developer who has spent considerable time navigating the intricacies of the Laravel framework, I understand the frustration of hitting cryptic errors while learning. The error you are encountering—BadMethodCallException Method [show] does not exist—is extremely common when working with resource routing in Laravel. It often stems from a misunderstanding of how Route::resource() automatically generates methods on your controller.
This post will break down exactly why this error occurs and provide the practical steps necessary to resolve it, ensuring you can build robust applications smoothly.
Understanding the Root Cause: Route Resource Mapping
The issue lies not in your database setup or model definition, but in the contract Laravel expects from your controller when you use Route::resource().
When you define a route using Route::resource('support', 'UserInfoController');, Laravel automatically assumes that the UserInfoController is responsible for handling all standard CRUD (Create, Read, Update, Delete) operations for the UserInfo model. This means it expects specific methods to be present in your controller: index, create, store, show, edit, update, and destroy.
The error message explicitly states that somewhere in the routing process, Laravel attempted to call a method named show() on your UserInfoController, but you have not defined it within the class. This happens because the route structure implies that a route exists for viewing a single resource (e.g., /support/{user_info}), which maps directly to the expected show method.
The Solution: Implementing Missing Controller Methods
To resolve this BadMethodCallException, you simply need to define the missing method—in this case, the show method—inside your UserInfoController. This method will be responsible for fetching and displaying the details of a single UserInfo record.
Here is how you should update your UserInfoController.php:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\UserInfo; // Ensure your model namespace is correct
class UserInfoController extends Controller
{
// Existing methods...
public function create(){
$userInfo = new UserInfo;
return view('contact', ['userInfo' => $userInfo]);
}
public function store(Request $request){
$this->validate($request, [
'name' => 'required',
'email' => 'required',
'subject' => 'required',
'description' => 'required',
]);
UserInfo::create($request->all());
return redirect()->route('contact')->with('success','Enquiry has been submitted successfully');
}
/**
* The missing method that resolves the error.
* This method handles fetching a single user record.
*/
public function show(UserInfo $userInfo) // Laravel automatically injects the model instance based on the route parameter
{
// Find the specific user record you want to display
$user = UserInfo::findOrFail($userInfo->id);
// Return the view with the loaded data
return view('support.show', ['user' => $user]);
}
// You would also need to implement index(), edit(), update(), and destroy() for a complete resource setup.
}
Best Practice: Using Route Model Binding
Notice how in the show method, we used public function show(UserInfo $userInfo). This is an excellent Laravel best practice known as Route Model Binding. Instead of manually fetching the user by ID within the controller (e.g., $user = UserInfo::findOrFail($this->id);), you leverage Laravel's routing system to automatically inject the correct Eloquent model instance based on the route parameters. This makes your code cleaner, safer, and more scalable—a core principle of modern application development on platforms like laravelcompany.com.
Conclusion
The BadMethodCallException Method [show] does not exist error is a classic indicator that you are using Laravel's resourceful routing conventions but have neglected to implement one of the expected CRUD methods in your controller. By systematically checking which routes are defined, and ensuring every action has a corresponding method in your controller—especially for resource routes—you will resolve this issue immediately. Keep practicing these fundamentals, and you’ll master Laravel development in no time!