Too few arguments to function App\Http\Controllers\CategoryController::destroy(), 0 passed and exactly 1 expected

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

Fixing the Eloquent Deletion Mystery: Why You Get "Too Few Arguments" in Laravel

As a senior developer working with the Laravel ecosystem, you inevitably run into errors that seem cryptic at first glance. The error message you are encountering—Too few arguments to function App\Http\Controllers\CategoryController::destroy(), 0 passed and exactly 1 expected—is a classic symptom of misunderstanding how Eloquent models interact with database operations. It usually signals a mismatch between the method you are calling (like delete()) and how Laravel expects that operation to be executed on an Eloquent object.

This post will dive deep into why this error happens when trying to delete records, examine your provided code structure, and show you the correct, idiomatic way to handle data deletion in a Laravel application.


Understanding the Root Cause: Eloquent Deletion Mechanics

The core issue lies not necessarily with the arguments passed to your controller method, but with how you are attempting to destroy the model instance within your controller. When working with Eloquent models, we rely on specific methods provided by the framework to abstract away raw SQL queries.

In your example, you have:

$category = Category::findOrFail($id);
$category->delele(); // <-- This is likely where the error originates
return redirect('/admin.category');

The method delete() on an Eloquent model instance is designed to handle the deletion process cleanly. If you are attempting to call a custom or misspelled method (like $category->delele()), PHP throws an error because that method does not exist, leading to confusing errors when Laravel tries to resolve the operation context.

The Correct Way to Destroy a Model Instance

To successfully delete a record retrieved from the database using Eloquent, you should call the built-in delete() method directly on the model instance. This method handles the necessary SQL execution behind the scenes, ensuring data integrity and following Laravel's conventions.

Solution 1: Using the Model Instance Deletion (Recommended)

The most straightforward and recommended approach is to retrieve the model and then call its delete() method.

In your CategoryController, you should modify the destroy function as follows:

use App\Models\Category; // Ensure you import your model
use Illuminate\Http\Request;

class CategoryController extends Controller
{
    public function destroy($id)
    {
        // 1. Find the category by ID. If not found, this will throw a ModelNotFoundException (404).
        $category = Category::findOrFail($id);

        // 2. Use the Eloquent delete method to remove the record from the database.
        $category->delete(); 

        // 3. Redirect the user after successful deletion.
        return redirect('/admin/category');
    }
}

Notice the difference: we replaced the non-existent $category->delele() with the valid Eloquent method, $category->delete(). This ensures that exactly one argument (the model instance) is passed to the method, satisfying Laravel’s expectations.

Alternative Deletion Strategies

While deleting a single model instance is done above, sometimes you might need to delete multiple records based on a condition, which is often more efficient than fetching each record individually.

Solution 2: Mass Deletion using Query Builder

For scenarios where you want to delete all categories matching a certain criteria (e.g., mass deletion), utilizing the Query Builder or Eloquent's static methods is preferred. This avoids the overhead of loading unnecessary model objects into memory.

public function destroyMass($ids)
{
    // Delete multiple records based on an array of IDs
    $deletedCount = Category::destroy($ids); 

    return redirect('/admin/category')->with('success', "Successfully deleted {$deletedCount} categories.");
}

This approach is highly efficient and aligns perfectly with the principles of database interaction taught within Laravel documentation, such as those found on https://laravelcompany.com. When dealing with collections or bulk operations, always favor Eloquent's static methods over looping through individual model deletions.

Conclusion

The error you faced was a classic case of calling an incorrect method name instead of utilizing the established conventions of the Eloquent ORM. By ensuring that your controller logic uses correct methods like $model->delete() or appropriate query builder functions, you move from encountering cryptic errors to writing clean, maintainable, and robust Laravel code. Always refer to official guides for the most up-to-date best practices when building your application on the foundation provided by https://laravelcompany.com.