how to pass object parameters using route() method in laravel5.4
i have a blade that should send id to controller for sorting
i just wanted to try a route with simple parameter to just see what happen but i'm getting error :(
this is my route call in blade
<a href="{{ route('sortby_followers' , ['id' => 8]) }}" > click </a>
this is my web.php
Route::get('/sortby=followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
and in controller code
public function sortby_followers($id)
{
dd($id);
}
but i got this error
Missing required parameters for [Route: sortby_followers] [URI:
sortby=followers/ali/ghasem/{id}]. (View:
C:wamp64wwwinstaresourcesviewsadminr_pagesshopproduct.blade.php)
i just wanted to see what happen and now i didn't route with object parameters
laravel routes laravel-5.4
add a comment |
i have a blade that should send id to controller for sorting
i just wanted to try a route with simple parameter to just see what happen but i'm getting error :(
this is my route call in blade
<a href="{{ route('sortby_followers' , ['id' => 8]) }}" > click </a>
this is my web.php
Route::get('/sortby=followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
and in controller code
public function sortby_followers($id)
{
dd($id);
}
but i got this error
Missing required parameters for [Route: sortby_followers] [URI:
sortby=followers/ali/ghasem/{id}]. (View:
C:wamp64wwwinstaresourcesviewsadminr_pagesshopproduct.blade.php)
i just wanted to see what happen and now i didn't route with object parameters
laravel routes laravel-5.4
add a comment |
i have a blade that should send id to controller for sorting
i just wanted to try a route with simple parameter to just see what happen but i'm getting error :(
this is my route call in blade
<a href="{{ route('sortby_followers' , ['id' => 8]) }}" > click </a>
this is my web.php
Route::get('/sortby=followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
and in controller code
public function sortby_followers($id)
{
dd($id);
}
but i got this error
Missing required parameters for [Route: sortby_followers] [URI:
sortby=followers/ali/ghasem/{id}]. (View:
C:wamp64wwwinstaresourcesviewsadminr_pagesshopproduct.blade.php)
i just wanted to see what happen and now i didn't route with object parameters
laravel routes laravel-5.4
i have a blade that should send id to controller for sorting
i just wanted to try a route with simple parameter to just see what happen but i'm getting error :(
this is my route call in blade
<a href="{{ route('sortby_followers' , ['id' => 8]) }}" > click </a>
this is my web.php
Route::get('/sortby=followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
and in controller code
public function sortby_followers($id)
{
dd($id);
}
but i got this error
Missing required parameters for [Route: sortby_followers] [URI:
sortby=followers/ali/ghasem/{id}]. (View:
C:wamp64wwwinstaresourcesviewsadminr_pagesshopproduct.blade.php)
i just wanted to see what happen and now i didn't route with object parameters
laravel routes laravel-5.4
laravel routes laravel-5.4
edited Nov 24 '18 at 13:08
Matthias
2,17852758
2,17852758
asked Nov 24 '18 at 6:24
Reza shReza sh
706
706
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
try this one
use /sortby_followers/{id}
instead of /sortby=followers/{id}
otherwise use like that
in blade use like that
<a href="{{ route('sortby_followers' , 8) }}">click</a>
in web
Route::get('/sortby_followers/{id}' ,'PageController@sortby_followers');
in controller
public function sortby_followers($id)
{
dd($id);
}
thanks , but i got the same error
– Reza sh
Nov 24 '18 at 6:51
@Rezash add here bro
– Jignesh Joisar
Nov 24 '18 at 7:02
add a comment |
Just change your route only in web.php
/sortby=followers/{id}
with /sortby_followers/{id}
Route::get('/sortby_followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
And also change your web link:
<a href="{{route('sortby_followers' , [8])}}" >click</a>
i did it, the same error
– Reza sh
Nov 24 '18 at 7:07
I have tested it working for me, you're missing something else. Check your routes setup again. It should work.
– Shail Paras
Nov 24 '18 at 7:16
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53455729%2fhow-to-pass-object-parameters-using-route-method-in-laravel5-4%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
try this one
use /sortby_followers/{id}
instead of /sortby=followers/{id}
otherwise use like that
in blade use like that
<a href="{{ route('sortby_followers' , 8) }}">click</a>
in web
Route::get('/sortby_followers/{id}' ,'PageController@sortby_followers');
in controller
public function sortby_followers($id)
{
dd($id);
}
thanks , but i got the same error
– Reza sh
Nov 24 '18 at 6:51
@Rezash add here bro
– Jignesh Joisar
Nov 24 '18 at 7:02
add a comment |
try this one
use /sortby_followers/{id}
instead of /sortby=followers/{id}
otherwise use like that
in blade use like that
<a href="{{ route('sortby_followers' , 8) }}">click</a>
in web
Route::get('/sortby_followers/{id}' ,'PageController@sortby_followers');
in controller
public function sortby_followers($id)
{
dd($id);
}
thanks , but i got the same error
– Reza sh
Nov 24 '18 at 6:51
@Rezash add here bro
– Jignesh Joisar
Nov 24 '18 at 7:02
add a comment |
try this one
use /sortby_followers/{id}
instead of /sortby=followers/{id}
otherwise use like that
in blade use like that
<a href="{{ route('sortby_followers' , 8) }}">click</a>
in web
Route::get('/sortby_followers/{id}' ,'PageController@sortby_followers');
in controller
public function sortby_followers($id)
{
dd($id);
}
try this one
use /sortby_followers/{id}
instead of /sortby=followers/{id}
otherwise use like that
in blade use like that
<a href="{{ route('sortby_followers' , 8) }}">click</a>
in web
Route::get('/sortby_followers/{id}' ,'PageController@sortby_followers');
in controller
public function sortby_followers($id)
{
dd($id);
}
answered Nov 24 '18 at 6:35
Jignesh JoisarJignesh Joisar
2,81511021
2,81511021
thanks , but i got the same error
– Reza sh
Nov 24 '18 at 6:51
@Rezash add here bro
– Jignesh Joisar
Nov 24 '18 at 7:02
add a comment |
thanks , but i got the same error
– Reza sh
Nov 24 '18 at 6:51
@Rezash add here bro
– Jignesh Joisar
Nov 24 '18 at 7:02
thanks , but i got the same error
– Reza sh
Nov 24 '18 at 6:51
thanks , but i got the same error
– Reza sh
Nov 24 '18 at 6:51
@Rezash add here bro
– Jignesh Joisar
Nov 24 '18 at 7:02
@Rezash add here bro
– Jignesh Joisar
Nov 24 '18 at 7:02
add a comment |
Just change your route only in web.php
/sortby=followers/{id}
with /sortby_followers/{id}
Route::get('/sortby_followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
And also change your web link:
<a href="{{route('sortby_followers' , [8])}}" >click</a>
i did it, the same error
– Reza sh
Nov 24 '18 at 7:07
I have tested it working for me, you're missing something else. Check your routes setup again. It should work.
– Shail Paras
Nov 24 '18 at 7:16
add a comment |
Just change your route only in web.php
/sortby=followers/{id}
with /sortby_followers/{id}
Route::get('/sortby_followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
And also change your web link:
<a href="{{route('sortby_followers' , [8])}}" >click</a>
i did it, the same error
– Reza sh
Nov 24 '18 at 7:07
I have tested it working for me, you're missing something else. Check your routes setup again. It should work.
– Shail Paras
Nov 24 '18 at 7:16
add a comment |
Just change your route only in web.php
/sortby=followers/{id}
with /sortby_followers/{id}
Route::get('/sortby_followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
And also change your web link:
<a href="{{route('sortby_followers' , [8])}}" >click</a>
Just change your route only in web.php
/sortby=followers/{id}
with /sortby_followers/{id}
Route::get('/sortby_followers/{id}' , [
'uses' => 'PageController@sortby_followers',
'as' => 'sortby_followers'
]);
And also change your web link:
<a href="{{route('sortby_followers' , [8])}}" >click</a>
edited Nov 24 '18 at 7:20
answered Nov 24 '18 at 6:59
Shail ParasShail Paras
8421028
8421028
i did it, the same error
– Reza sh
Nov 24 '18 at 7:07
I have tested it working for me, you're missing something else. Check your routes setup again. It should work.
– Shail Paras
Nov 24 '18 at 7:16
add a comment |
i did it, the same error
– Reza sh
Nov 24 '18 at 7:07
I have tested it working for me, you're missing something else. Check your routes setup again. It should work.
– Shail Paras
Nov 24 '18 at 7:16
i did it, the same error
– Reza sh
Nov 24 '18 at 7:07
i did it, the same error
– Reza sh
Nov 24 '18 at 7:07
I have tested it working for me, you're missing something else. Check your routes setup again. It should work.
– Shail Paras
Nov 24 '18 at 7:16
I have tested it working for me, you're missing something else. Check your routes setup again. It should work.
– Shail Paras
Nov 24 '18 at 7:16
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53455729%2fhow-to-pass-object-parameters-using-route-method-in-laravel5-4%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown