Laravel Notes

These are my notes as I am learning Laravel. Its gets overwhelming looking at the documentation and tutorials so I made this post.

How to create a new laravel project.
Navigate to htdocs folder of development server and use this command

laravel new appname 

To build a new app with authentication use this command

laravel new appname --auth 
How to run a specific migration file.
use this command

php artisan migrate --path=/database/migrations/migration_file.php 
How to add a back link.
use this command

<a href="{{ url()->previous() }}">Back</a>

This will link back to previous page.

Database Migration documentation.
If you need to view column types when building your table in a migration file.

https://laravel.com/docs/7.x/migrations#introduction
How to create migration file.
Command to build a new migration file.

php artisan make:migration create_tablename_table --create=tablename
How to view all route.
Use this command.

php artisan route:list




Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.