Build a Task List with Laravel 5.4 and Vue 2
We’re going to follow along with @felicianopj post that is available here. The source code for this tutorial is on github.
Create application
I have a short shell script in my Projects folder that I run to create fresh Laravel apps (link to gist) ⭐
So run the script like:
$ ./create_laravel_app.sh laravel-vue-tasks
$ cd laravel-vue-tasks
Database stuff 📊
We have a Laravel app and we need to store our tasks in the database.
This one artisan command creates the model, a migration file and a resource controller.
$ php artisan make:model Task -mr
In the model file we need to tell Laravel that the attributes of the database are “mass assignable”. To do this and turn off some of Laravel’s security by default functionality we set $guarded to an empty array like so:
app/Task.php
<?phpnamespace App;