how to pass object parameters using route() method in laravel5.4












0















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










share|improve this question





























    0















    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










    share|improve this question



























      0












      0








      0








      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 24 '18 at 13:08









      Matthias

      2,17852758




      2,17852758










      asked Nov 24 '18 at 6:24









      Reza shReza sh

      706




      706
























          2 Answers
          2






          active

          oldest

          votes


















          0














          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);
          }





          share|improve this answer
























          • 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



















          0














          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>





          share|improve this answer


























          • 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











          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          0














          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);
          }





          share|improve this answer
























          • 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
















          0














          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);
          }





          share|improve this answer
























          • 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














          0












          0








          0







          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);
          }





          share|improve this answer













          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);
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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













          0














          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>





          share|improve this answer


























          • 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
















          0














          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>





          share|improve this answer


























          • 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














          0












          0








          0







          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>





          share|improve this answer















          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>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          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



















          • 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


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          To store a contact into the json file from server.js file using a class in NodeJS

          Marschland

          Redirect URL with Chrome Remote Debugging Android Devices