Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sgupta1979's avatar

Laravel upgraded 5.6 to 6 - getting PHP error

Hello All,

I have upgraded Laravel version from 5.6 to 6. PHP version is 7.4

After upgradation I am getting below PHP error in my application.

namespace Illuminate\Routing\Exceptions; use Exception; class UrlGenerationException extends Exception{ /** * Create a new exception for missing route parameters. * * @param \Illuminate\Routing\Route $route * @return static */ public static function forMissingParameters($route) { return new static("Missing required parameters for [Route: {$route->getName()}] [URI: {$route->uri()}]."); }

Pleasse guide me ... How we can fix?

0 likes
5 replies
LaryAI's avatar
Level 58

The error message seems to be incomplete, but based on the code snippet provided, it looks like there might be an issue with the UrlGenerationException class. One possible solution is to make sure that the class is properly imported and that the namespace is correct.

Here's an example of how to import the class and use it in a Laravel 6 application:

<?php

namespace App\Http\Controllers;

use Illuminate\Routing\Exceptions\UrlGenerationException;

class MyController extends Controller
{
    public function myMethod()
    {
        try {
            // your code here
        } catch (UrlGenerationException $e) {
            // handle the exception
        }
    }
}

Make sure to update the namespace and class names to match your application's structure. If this doesn't solve the issue, please provide more information about the error message and any other relevant details.

sgupta1979's avatar

Hello

This is occuring through the application for generating URL in Routes/web.php Here I am pasting error for one of the URL

"Missing required parameters for [Route: engagements.synchronize] [URI: synchronize/{id}]. (View: C:\wamp64\www\NASLAApps\naslaapps-slawizard\resources\views\backend\engagements.blade.php) ◀"

In Routes/web.php the code has been written for URL formation is like below

Route::post('/synchronize/{id}/', 'Backend\EngagementController@synchronize')->name('engagements.synchronize');

javierroman's avatar

@sgupta1979 You have to change the syntax to:

Route::post('/synchronize/{id}/', [Backend\EngagementController::class, 'synchronize'])->name('engagements.synchronize');

sgupta1979's avatar

Hello I changed it to

Route::post('/synchronize/{id}/', [Backend\EngagementController::class, 'synchronize'])->name('engagements.synchronize');

Even throwing same error

javierroman's avatar

@sgupta1979 Sorry I told you the syntax for routes for Laravel 8 or more. For Laravel 6 your syntax was fine. Maybe the problem is the trailing slash in the URL. Can you try removing the trailing slash like this:

Route::post('/synchronize/{id}', 'Backend\EngagementController@synchronize')->name('engagements.synchronize');

Please or to participate in this conversation.