interact with different language pages in vuejs and laravel - laravel

I'm building a multi language website using Laravel and VueJS. I've build many vue components and laravel blade files in same html structure and those are different languages. I suppose to make different route file to each language.
But my problem is I cannot switch between different language. Please let me know how to do that?

If you're using blade and Vue as a library you can use https://github.com/mcamara/laravel-localization
If you're using Vue as SPA you can use https://github.com/kazupon/vue-i18n

Related

How can I use laravel localization into vue components?

I'm currently working on application's translation with Laravel Localization (laravel 5.6).
I succeed my text translation on blade templates but I have some view using vuejs.
Into them I can't use directly laravel localization.
I understand that I have to send my translations files (which are in PHP) into the vue in JS.
I found some packages like :
https://github.com/rmariuzzo/Laravel-JS-Localization ; but it doesn't support laravel 5.6 (damned)...
https://github.com/martinlindhe/laravel-vue-i18n-generator ; Laravel 5 package is no longer maintain...
This application use Laravel 5.6 and vue 2.
I can't completely reorganize or upgrade Laravel or vue version.
After many research I'm still not able to do it...
Do you know how can I made translation into my vue component?
Thanks a a lot!

Few questions when it comes to building an e-commerce website in Laravel and vue

I have a few questions regarding building an e-commerce website. I want to program a small e-commerce website using Laravel and Vue. I know the basics of Laravel and Vue, but I'm struggling when it comes to selecting the best plan to program the website. So I have a few questions regarding that.
Should an e-commerce website be dynamic or SPA?
Should I use a Vue router or built-in Laravel router?
Is it good practice to mix Vue components and Blade Template or should I separate Vue and Laravel when it comes to the frontend?
Suggest you use nuxt universal, cuz need seo, spa didnt index well in search engine
For client side use Vue router, for rest api use laravel router
If you use vue + nuxt dont need blade

Include Vue in a Codeigniter project

I have a very broad project, developed in codeigniter, I want to integrate Vue and I do not know how to do it.
Is it better to create a new project based on Vue and try to migrate things?
Modify my JS of my current project and replace it with Vue?
What do you recommend?
i have sucessfully use vue to replace codeigniter view layer, i use laravel mixin to compile vue SFC then include built file to the codeigniter view template
FrontEnd frameworks has nothing to do backend frameworks. They communicate via http-request responses.
You may use backend of your choice and render the content on the page.
However, if you want to integrate vue with existing project (which is already working), I recommend new project based on Vue and migrate back end code on need basis

Integrate Vue.js with laravel

I have built my static design using vue.js. Now, I need to integrate it within Laravel.
Once I do integrate Laravel with Vue then Laravel is not getting the Design files path. I mean the various Style and JS files.
FYI, I build the Vue in static design and it was working fine before integration with Laravel. But, while integrating with Laravel I am no longer using the build or build.js file. Instead of this, I am building using Laravel ways.
The main issue is the design is broken and the route is not working.

how to uses ReactJS and Laravel

how to combine Laravel and React? I mean, Laravel uses blade for its view, how to change it to React instead of blade ? There have been so many Laravel and Angular tutorial, but I can't find any for React and Laravel?
Any references of Laravel and ReactJS tutorial ?
If you are using Laravel to build a REST web service (API), then you might not need Blade. You just return JSON data. Your React App can then make calls to the Laravel API for data and process it right in the browser. You don't need Blade for this.
You would use Laravel to provide the base view (index.blade.php) which would include the React JS app, but then after that all the views and routing would be handled by React.
Here's a link to get you started.
https://medium.com/#rajikaimal/laravel-loves-reactjs-8c02f8b9d1d5
I have created laravel reactjs starter project .. refer the github project below.
I am not using the mix api of laravel since I want reactjs app to be portable to any other server or standalone app
refer the link below
https://medium.com/#padmanabhavn/bringing-laravel-and-reactjs-together-8c970cb0f65d
This question seems old but I will still share my experience for others.
This tutorial and project sample may be found useful.
https://blog.pusher.com/react-laravel-application/
https://github.com/maarcz/taskman
As well as that, the solution below has worked for me in webpack.mix.js without using app.js to be mixed up with other requirements (laravel 8):
mix.js('resources/assets/js/react', 'public/js/reactJs').react()
in blade:
<script src="{{ asset('js/reactJs/react.js') }}"></script>

Resources