Laravel - URL Generation - Urls For Controller Actions
The action
function generates a URL for the given controller action:
use App\Http\Controllers\HomeController;
$url = action([HomeController::class, 'index']);
If the controller method accepts route parameters, you may pass an associative array of route parameters as the second argument to the function:
$url = action([UserController::class, 'profile'], ['id' => 1]);