John Davidson

php - Laravel how i get route with name in blade

0 comments
Message:


I have a route same like this.


Route::group(['prefix'=>LaravelLocalization::setLocale(),
'as'=>'front.',
'middleware'=>['localeSessionRedirect','localizationRedirect',]],function ()
{
Route::get('/view/post/{id}', [ExtraController::class, 'SinglePost'])->name('post_view');
});

So i want call this route in blade.How i get post_view route?



My Answer:
'admin'], function () {
Route::get('dashboard', 'AdminController@dashboard')->name('admin.dashboard');
});

In your blade file, you can use the route() helper function to generate the URL for the named route like this:

php
Dashboard


This will generate the URL for the 'admin.dashboard' route and output it in the href attribute of the anchor tag.

Rate this post

3 of 5 based on 7223 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us