So guys this is kind of easy guide to get stated with Laravel and VueJS, Basically Laravel basic package comes along with VueJS and Axios which is listed in package.json, you could just take a look there to make sure they are sitting there!
Install Laravel (Latest)
Installing Laravel on our local machine is easy, simply we can just run composer install command then everything can be done
automagically, here the official link regarding Laravel
installation.
 |
Laravel install using composer. |
╭─yoesoff@yoesoff-ThinkPad-X220 ~/Documents/projects/labs
╰─➤ composer create-project --prefer-dist laravel/laravel vblog
Here is my installation
logs.
Run Built-In Web Server
To run your Laravel application with the PHP server, simply execute the following command at the root of your project.
╭─yoesoff@yoesoff-ThinkPad-X220 ~/Documents/projects/labs/vblog
╰─➤ ./artisan serve
 |
Laravel is running on port 8000 |
Installing All Javascript Stuff
The only remaining step is to install Laravel Mix. Within a fresh installation of Laravel, you'll find a package.json file in the root of your directory structure. The default package.json file includes everything you need to get started. You may install the dependencies it references by running:
╭─yoesoff@yoesoff-ThinkPad-X220 ~/Documents/projects/labs/vblog
╰─➤ npm install
 |
npm install |
Compile All Client Side Scripts
╭─yoesoff@yoesoff-ThinkPad-X220 ~/Documents/projects/labs/vblog
╰─➤ npm run dev
 |
npm run dev |
Compile and Watch all Changes
╭─yoesoff@yoesoff-ThinkPad-X220 ~/Documents/projects/labs/vblog
╰─➤ npm run watch
 |
npm run watch |
Run Existingf Example Component
 |
Existing Vue Component |
app.blade.php
index.blade.php
Web Router
 |
routes |
Result
Sampai disini kita sudah meng-setup Laravel kita untuk dapat bekerja dangan VueJS dan komponen-komponen pendukungnya.
Comments
Post a Comment