how to access the current page id in vue js and laravelHow can I prevent SQL injection in PHP?How do I check if a string contains a specific word?Laravel won't use bladesvue.js 2.0 load component dynamically in laravel 5.3Vuejs 2 with Laravel 5.4 backend, post (Unauthorized) errorImport Vue Component only when added to blade pagesRouting on Vue with SSR and Laravelaccess method outside vue componentHow to combine laravel and vue routesHow to extend new Vue() in blades files

Inward extrusion is not working

Prime Sieve and brute force

Is a lack of character descriptions a problem?

With Ubuntu 18.04, how can I have a hot corner that locks the computer?

Is it possible to have a wealthy country without a middle class?

Pre-1972 sci-fi short story or novel: alien(?) tunnel where people try new moves and get destroyed if they're not the correct ones

Arriving at the same result with the opposite hypotheses

Is it legal for a bar bouncer to confiscate a fake ID

Zeros of the Hadamard product of holomorphic functions

Is this use of the expression "long past" correct?

Generate basis elements of the Steenrod algebra

Mathematically, why does mass matrix / load vector lumping work?

Need feedback - Can the composition/colors of this design be fixed if something is lacking or is not a better fit?

Are there any important biographies of nobodies?

Winning Strategy for the Magician and his Apprentice

How does an ordinary object become radioactive?

Is an entry level DSLR going to shoot nice portrait pictures?

Meaning of 'lose their grip on the groins of their followers'

Union with anonymous struct with flexible array member

Is it a problem if <h4>, <h5> and <h6> are smaller than regular text?

How do I prevent employees from either switching to competitors or opening their own business?

Compiling C files on Ubuntu and using the executable on Windows

What can I, as a user, do about offensive reviews in App Store?

Rebus with 20 song titles



how to access the current page id in vue js and laravel


How can I prevent SQL injection in PHP?How do I check if a string contains a specific word?Laravel won't use bladesvue.js 2.0 load component dynamically in laravel 5.3Vuejs 2 with Laravel 5.4 backend, post (Unauthorized) errorImport Vue Component only when added to blade pagesRouting on Vue with SSR and Laravelaccess method outside vue componentHow to combine laravel and vue routesHow to extend new Vue() in blades files






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















i am working on a blog with laravel and vuejs and i have written the comment part as a vuecomponent and inserted that in show function of my post like this



 @section('content');
.
.
.

<comment></comment>
@endsection


where above i show the single post and the comment section below it .now i want to access 2 things 1-the user id who enters the comment and the more important the id of the post which the user is currently seeing in my case for example its



http://localhost:8000/blog/8


that number 8 . as far as i cant use blade and php in vue component how should i access them in vue component .










share|improve this question




























    0















    i am working on a blog with laravel and vuejs and i have written the comment part as a vuecomponent and inserted that in show function of my post like this



     @section('content');
    .
    .
    .

    <comment></comment>
    @endsection


    where above i show the single post and the comment section below it .now i want to access 2 things 1-the user id who enters the comment and the more important the id of the post which the user is currently seeing in my case for example its



    http://localhost:8000/blog/8


    that number 8 . as far as i cant use blade and php in vue component how should i access them in vue component .










    share|improve this question
























      0












      0








      0








      i am working on a blog with laravel and vuejs and i have written the comment part as a vuecomponent and inserted that in show function of my post like this



       @section('content');
      .
      .
      .

      <comment></comment>
      @endsection


      where above i show the single post and the comment section below it .now i want to access 2 things 1-the user id who enters the comment and the more important the id of the post which the user is currently seeing in my case for example its



      http://localhost:8000/blog/8


      that number 8 . as far as i cant use blade and php in vue component how should i access them in vue component .










      share|improve this question














      i am working on a blog with laravel and vuejs and i have written the comment part as a vuecomponent and inserted that in show function of my post like this



       @section('content');
      .
      .
      .

      <comment></comment>
      @endsection


      where above i show the single post and the comment section below it .now i want to access 2 things 1-the user id who enters the comment and the more important the id of the post which the user is currently seeing in my case for example its



      http://localhost:8000/blog/8


      that number 8 . as far as i cant use blade and php in vue component how should i access them in vue component .







      php laravel vue.js






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 18:13









      FarshadFarshad

      376215




      376215






















          1 Answer
          1






          active

          oldest

          votes


















          1














          There are quite a number of things you need to do.



          First, if you aren't doing that already, you need send the value of the single post and the user from your controller. You can then access it in the blade file. This post might help



          Next, you should pass the post_id and user_id as props to the component like so:



          <comment post_id="$post->id" user_id="$user->id"></comment>



          Lastly, make sure you register the props in your 'comment' component:



          props: ['post_id', 'user_id']






          share|improve this answer























          • that was really time saver thanks it helped alot :)

            – Farshad
            Mar 24 at 19:24











          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%2f55326941%2fhow-to-access-the-current-page-id-in-vue-js-and-laravel%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          There are quite a number of things you need to do.



          First, if you aren't doing that already, you need send the value of the single post and the user from your controller. You can then access it in the blade file. This post might help



          Next, you should pass the post_id and user_id as props to the component like so:



          <comment post_id="$post->id" user_id="$user->id"></comment>



          Lastly, make sure you register the props in your 'comment' component:



          props: ['post_id', 'user_id']






          share|improve this answer























          • that was really time saver thanks it helped alot :)

            – Farshad
            Mar 24 at 19:24















          1














          There are quite a number of things you need to do.



          First, if you aren't doing that already, you need send the value of the single post and the user from your controller. You can then access it in the blade file. This post might help



          Next, you should pass the post_id and user_id as props to the component like so:



          <comment post_id="$post->id" user_id="$user->id"></comment>



          Lastly, make sure you register the props in your 'comment' component:



          props: ['post_id', 'user_id']






          share|improve this answer























          • that was really time saver thanks it helped alot :)

            – Farshad
            Mar 24 at 19:24













          1












          1








          1







          There are quite a number of things you need to do.



          First, if you aren't doing that already, you need send the value of the single post and the user from your controller. You can then access it in the blade file. This post might help



          Next, you should pass the post_id and user_id as props to the component like so:



          <comment post_id="$post->id" user_id="$user->id"></comment>



          Lastly, make sure you register the props in your 'comment' component:



          props: ['post_id', 'user_id']






          share|improve this answer













          There are quite a number of things you need to do.



          First, if you aren't doing that already, you need send the value of the single post and the user from your controller. You can then access it in the blade file. This post might help



          Next, you should pass the post_id and user_id as props to the component like so:



          <comment post_id="$post->id" user_id="$user->id"></comment>



          Lastly, make sure you register the props in your 'comment' component:



          props: ['post_id', 'user_id']







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 24 at 18:59









          Mofope OjoshMofope Ojosh

          262




          262












          • that was really time saver thanks it helped alot :)

            – Farshad
            Mar 24 at 19:24

















          • that was really time saver thanks it helped alot :)

            – Farshad
            Mar 24 at 19:24
















          that was really time saver thanks it helped alot :)

          – Farshad
          Mar 24 at 19:24





          that was really time saver thanks it helped alot :)

          – Farshad
          Mar 24 at 19:24



















          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%2f55326941%2fhow-to-access-the-current-page-id-in-vue-js-and-laravel%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript