Ad
Laravel Pathing In Link
I am using same thing but result is different. In posts.blade.php i can call like this
<a href = "posts/{{post->id}}"edit>Edit</a>
But when i use same thing in rooms.blade.php indisde rooms folder i had to use like this.
<a href = "{{$room->id}}/edit" class = 'btn btn-primary'> Edit</a>
It is really confusing me. Any solution? i want to add link for editing post inside room. I have tried many things but i dont understand.
My Route
Route::get('/','[email protected]');
Route::get('/about', '[email protected]');
Route::get('/services', '[email protected]');
Route::get('/register', '[email protected]');
Route::get('/logout', '[email protected]');
Route::get('/posts', '[email protected]');
Route::resource('posts','PostsController');
Route::resource('rooms','RoomsController');
Auth::routes();
Route::get('/dashboard', '[email protected]');
Ad
Answer
You can give the name of the route
Foe example:
Route::get('/post/{id}', '[email protected]')->name('post.show');
And then call the blade
<a target="_blank" rel="nofollow noreferrer" href="{{ route('posts.show', [$id]) }}">Link to Resource {{ $id }}</a>
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad