In this article I will show you how to create a simple to-do application using Laravel. Let’s start by creating the project:
This will create the project in the directory
to_do. You can figure this application to work with
homestead box for
vagrant) and serve the application using a virtualization provider like
virtualbox. However, we will just use the
artisan utility to serve the application.
to_do and issue:
If you point your browser to
http://localhost:8000 you will be able to see the default
Registration and Login
This is an essential part of almost all web applications. Adding your own registration, login and logout logic is fairly straight forward when you use
Laravel. The best thing is that quite often you simply need a simple logic that handles this and
Laravel comes with this feature out of the box.
Inorder to enable this you simply need to issue:
Laravel will even create necessary views for registration, login, password reset etc.
Laravel supports connecting to different types of databases and you can configure this in
.env file. By default it has the following database entries:
If you wish to use
mysql for your application you may want to update the entries accordingly.
For our demo, let’s use
sqlite. For this change the entries to:
Now we need to tell laravel where to find the
sqlite database. To configure this open
config/database.php and you will see: