crud (1)


Tasks CRUD with Laravel 5.5

If you read the last posts you already understand how MVC is applied in Laravel, but our example can be more powerful and next to real world. What if we made a little CRUD demonstration with Laravel 5.5.

Let’s do that!

Well,  start a new project called task. And let’s remember some things.

Initial config –  Homestead

I’m supposing that you have Homestead installed, if not see the documentation:
https://laravel.com/docs/5.5/homestead

First configuration steps, remember change hosts file /etc/hosts to add the line:

Make some changes in Homestead.yaml (Usually in /Users/YOURUSER/Homestead/Homestead.yaml) to map new site.

Only to understand, we are creating the map (links) and the database for it project.

Now restart your homestead

Is everything fine? Get to work!

First steps in Laravel 5.5

The .env file
Remember to change these variables in your .env file

Please attention in DB_HOST=192.168.10.10. I like to use the IP of homestead because in this way we can do php artisan migrate out of vagrant ssh. The default password of MySQL Homestead is secret.

First step, creating a model with migration