No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [SOLVED] How to correctly load a quasar SPA from the Laravel Public Folder?

    Help
    1
    3
    2251
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mesqueeb
      mesqueeb last edited by mesqueeb

      Hey Guys, did anyone ever try to copy the DIST folder of Quasar into the Laravel public folder?
      I made a quick laravel mix setup:

      mix
         .copyDirectory('resources/quasarSPA/dist/js', 'public/js')
         .copyDirectory('resources/quasarSPA/dist/img', 'public/img')
         .copyDirectory('resources/quasarSPA/dist/fonts', 'public/fonts')
         .copyDirectory('resources/quasarSPA/dist/statics', 'public/statics')
         .copyDirectory('resources/quasarSPA/dist/', 'public/quasarSPA')
      // The only file that needed to be hand copied was the css file in the dist folder of Quasar, because it has a different name every time.
      

      Then I set up my route and controller to return this:

          public function quasarSPAView()
          {
              return \File::get(public_path() . '/quasarSPA/index.html');
          }
      

      However, when opening the laravel dev server, all quasar dist files load properly in the network tab, but nothing shows up …

      Any ideas?

      This is what my network tab looks like: 0_1498497474002_スクリーンショット 2017-06-26 20.55.38.png

      1 Reply Last reply Reply Quote 0
      • mesqueeb
        mesqueeb last edited by

        If I use the terminal to go to the laravel public directory, then do quasar server or laravel serve and add the correct URI: /quasarSPA/index.html then it works… but this defeats the Laravel routing functionality I think…

        1 Reply Last reply Reply Quote 0
        • mesqueeb
          mesqueeb last edited by mesqueeb

          The answer was:

          return \File::get(public_path() . '/SPAindex.html');
          

          can work perfectly, but you CANNOT delete Laravel’s index.php file inside the public folder.
          that’s why you need to make sure you change the name of the index.html specially for your SPA!

          • Make sure you got the original index.php inside the public folder.
          • If you still get a blank screen you need to: php artisan cache:clear and meta+shift+R to force a full css refresh. (this was my problem where the files would show up in network, but i’d get a blank screen)

          (BTW, no need to run laravel mix for anything)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post