How to make redirection to some vue form from laravel's control?












2














In my Laravel 5.6 application with vue.js 2.5.7 I and vue-router 3
I use Socialite for login into the system
and in case of success I need to make redirection to some vue form with success message and next options available.



For this I make redirection like:



    $url= $site_hosting . "/home";
return redirect()->route($url, )->with([
'text' => 'google_new_user',
'type' => 'success',
'action' => 'successful_login'
]);


where url has value like



example.com/home


the question is that I do not know how redirecting from Laravel control to point to Vue component, defined in resources/assets/js/app.js file as



const routes = [
{
components: {
notFound: NotFound,
...


How can it be done ?



MODIFIED BLOCK # 2
Thank you for the link, but actually I did not catch the decision.
I see in laravel's route file url with "vue_capture" defintion,
but in url examples there are



/resource/, 
/posts/,
/posts/{slug}


and “storage” in reg expression. What are "storage"/"vue_capture" some predefined names for some actions ?
Could you, please, give some detailed explanations how it would work, as I need FROM lasravel's action to open vue form?



Also I starting working with vue reading some docs/videos and now my router is defined as :



const router = new VueRouter( {
mode: 'hash', // default
routes
})


with a lot of routes defined.
I mean mode has different value here. Will this example work with this option ?



Thanks!










share|improve this question
























  • It's not very clear what you do/don't yet already have in your code. Have you added a route in your routes/web.php file to capture VueRouter requests? And do the routes in your app.js file have paths?
    – Delena Malan
    Nov 13 at 21:41










  • I am not sure what have I to add in routes/web.php and app.js files... Could you please to give some examples or links to such examples? I hope I explained the problem clearly?
    – mstdmstd
    Nov 14 at 8:04






  • 1




    dev.to/mozartted/… could help. Are you basing your code off of any tutorial or template?
    – Delena Malan
    Nov 14 at 8:44










  • Olease look at MODIFIED BLOCK # 2
    – mstdmstd
    Nov 14 at 11:38
















2














In my Laravel 5.6 application with vue.js 2.5.7 I and vue-router 3
I use Socialite for login into the system
and in case of success I need to make redirection to some vue form with success message and next options available.



For this I make redirection like:



    $url= $site_hosting . "/home";
return redirect()->route($url, )->with([
'text' => 'google_new_user',
'type' => 'success',
'action' => 'successful_login'
]);


where url has value like



example.com/home


the question is that I do not know how redirecting from Laravel control to point to Vue component, defined in resources/assets/js/app.js file as



const routes = [
{
components: {
notFound: NotFound,
...


How can it be done ?



MODIFIED BLOCK # 2
Thank you for the link, but actually I did not catch the decision.
I see in laravel's route file url with "vue_capture" defintion,
but in url examples there are



/resource/, 
/posts/,
/posts/{slug}


and “storage” in reg expression. What are "storage"/"vue_capture" some predefined names for some actions ?
Could you, please, give some detailed explanations how it would work, as I need FROM lasravel's action to open vue form?



Also I starting working with vue reading some docs/videos and now my router is defined as :



const router = new VueRouter( {
mode: 'hash', // default
routes
})


with a lot of routes defined.
I mean mode has different value here. Will this example work with this option ?



Thanks!










share|improve this question
























  • It's not very clear what you do/don't yet already have in your code. Have you added a route in your routes/web.php file to capture VueRouter requests? And do the routes in your app.js file have paths?
    – Delena Malan
    Nov 13 at 21:41










  • I am not sure what have I to add in routes/web.php and app.js files... Could you please to give some examples or links to such examples? I hope I explained the problem clearly?
    – mstdmstd
    Nov 14 at 8:04






  • 1




    dev.to/mozartted/… could help. Are you basing your code off of any tutorial or template?
    – Delena Malan
    Nov 14 at 8:44










  • Olease look at MODIFIED BLOCK # 2
    – mstdmstd
    Nov 14 at 11:38














2












2








2







In my Laravel 5.6 application with vue.js 2.5.7 I and vue-router 3
I use Socialite for login into the system
and in case of success I need to make redirection to some vue form with success message and next options available.



For this I make redirection like:



    $url= $site_hosting . "/home";
return redirect()->route($url, )->with([
'text' => 'google_new_user',
'type' => 'success',
'action' => 'successful_login'
]);


where url has value like



example.com/home


the question is that I do not know how redirecting from Laravel control to point to Vue component, defined in resources/assets/js/app.js file as



const routes = [
{
components: {
notFound: NotFound,
...


How can it be done ?



MODIFIED BLOCK # 2
Thank you for the link, but actually I did not catch the decision.
I see in laravel's route file url with "vue_capture" defintion,
but in url examples there are



/resource/, 
/posts/,
/posts/{slug}


and “storage” in reg expression. What are "storage"/"vue_capture" some predefined names for some actions ?
Could you, please, give some detailed explanations how it would work, as I need FROM lasravel's action to open vue form?



Also I starting working with vue reading some docs/videos and now my router is defined as :



const router = new VueRouter( {
mode: 'hash', // default
routes
})


with a lot of routes defined.
I mean mode has different value here. Will this example work with this option ?



Thanks!










share|improve this question















In my Laravel 5.6 application with vue.js 2.5.7 I and vue-router 3
I use Socialite for login into the system
and in case of success I need to make redirection to some vue form with success message and next options available.



For this I make redirection like:



    $url= $site_hosting . "/home";
return redirect()->route($url, )->with([
'text' => 'google_new_user',
'type' => 'success',
'action' => 'successful_login'
]);


where url has value like



example.com/home


the question is that I do not know how redirecting from Laravel control to point to Vue component, defined in resources/assets/js/app.js file as



const routes = [
{
components: {
notFound: NotFound,
...


How can it be done ?



MODIFIED BLOCK # 2
Thank you for the link, but actually I did not catch the decision.
I see in laravel's route file url with "vue_capture" defintion,
but in url examples there are



/resource/, 
/posts/,
/posts/{slug}


and “storage” in reg expression. What are "storage"/"vue_capture" some predefined names for some actions ?
Could you, please, give some detailed explanations how it would work, as I need FROM lasravel's action to open vue form?



Also I starting working with vue reading some docs/videos and now my router is defined as :



const router = new VueRouter( {
mode: 'hash', // default
routes
})


with a lot of routes defined.
I mean mode has different value here. Will this example work with this option ?



Thanks!







laravel-5 vuejs2 vue-router






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 at 11:37

























asked Nov 13 at 16:51









mstdmstd

530414




530414












  • It's not very clear what you do/don't yet already have in your code. Have you added a route in your routes/web.php file to capture VueRouter requests? And do the routes in your app.js file have paths?
    – Delena Malan
    Nov 13 at 21:41










  • I am not sure what have I to add in routes/web.php and app.js files... Could you please to give some examples or links to such examples? I hope I explained the problem clearly?
    – mstdmstd
    Nov 14 at 8:04






  • 1




    dev.to/mozartted/… could help. Are you basing your code off of any tutorial or template?
    – Delena Malan
    Nov 14 at 8:44










  • Olease look at MODIFIED BLOCK # 2
    – mstdmstd
    Nov 14 at 11:38


















  • It's not very clear what you do/don't yet already have in your code. Have you added a route in your routes/web.php file to capture VueRouter requests? And do the routes in your app.js file have paths?
    – Delena Malan
    Nov 13 at 21:41










  • I am not sure what have I to add in routes/web.php and app.js files... Could you please to give some examples or links to such examples? I hope I explained the problem clearly?
    – mstdmstd
    Nov 14 at 8:04






  • 1




    dev.to/mozartted/… could help. Are you basing your code off of any tutorial or template?
    – Delena Malan
    Nov 14 at 8:44










  • Olease look at MODIFIED BLOCK # 2
    – mstdmstd
    Nov 14 at 11:38
















It's not very clear what you do/don't yet already have in your code. Have you added a route in your routes/web.php file to capture VueRouter requests? And do the routes in your app.js file have paths?
– Delena Malan
Nov 13 at 21:41




It's not very clear what you do/don't yet already have in your code. Have you added a route in your routes/web.php file to capture VueRouter requests? And do the routes in your app.js file have paths?
– Delena Malan
Nov 13 at 21:41












I am not sure what have I to add in routes/web.php and app.js files... Could you please to give some examples or links to such examples? I hope I explained the problem clearly?
– mstdmstd
Nov 14 at 8:04




I am not sure what have I to add in routes/web.php and app.js files... Could you please to give some examples or links to such examples? I hope I explained the problem clearly?
– mstdmstd
Nov 14 at 8:04




1




1




dev.to/mozartted/… could help. Are you basing your code off of any tutorial or template?
– Delena Malan
Nov 14 at 8:44




dev.to/mozartted/… could help. Are you basing your code off of any tutorial or template?
– Delena Malan
Nov 14 at 8:44












Olease look at MODIFIED BLOCK # 2
– mstdmstd
Nov 14 at 11:38




Olease look at MODIFIED BLOCK # 2
– mstdmstd
Nov 14 at 11:38












1 Answer
1






active

oldest

votes


















0














Check out vue router. https://router.vuejs.org/



Here's an in depth tutorial https://laravel-news.com/using-vue-router-laravel






share|improve this answer





















    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%2f53285882%2fhow-to-make-redirection-to-some-vue-form-from-laravels-control%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









    0














    Check out vue router. https://router.vuejs.org/



    Here's an in depth tutorial https://laravel-news.com/using-vue-router-laravel






    share|improve this answer


























      0














      Check out vue router. https://router.vuejs.org/



      Here's an in depth tutorial https://laravel-news.com/using-vue-router-laravel






      share|improve this answer
























        0












        0








        0






        Check out vue router. https://router.vuejs.org/



        Here's an in depth tutorial https://laravel-news.com/using-vue-router-laravel






        share|improve this answer












        Check out vue router. https://router.vuejs.org/



        Here's an in depth tutorial https://laravel-news.com/using-vue-router-laravel







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 13 at 16:55









        Marina Mosti

        23017




        23017






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f53285882%2fhow-to-make-redirection-to-some-vue-form-from-laravels-control%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

            Guess what letter conforming each word

            Port of Spain

            Run scheduled task as local user group (not BUILTIN)