Create a manual login system in Laravel using Attempt function


Create a manual login system in Laravel using Attempt function

In this article, we learn how to create a manual login in Laravel. The Laravel framework is characterized by the presence of many ready-made systems that can be used completely without an urgent need to do much work.

It's just a matter of going to the command line and typing just one line, you'll notice that you've created what previously took hours of hard work to do with PHP.

Laravel system features

This is one of the most important basic features of Laravel when used in frameworks, if we want to take a vivid example of this talk, we should first mention that Laravel comes with an integrated system that is pre-made and ready to use, this command can be activated as follows through the command line in Laravel:

php artisan make:auth

Of course, it is difficult for a person to understand this matter, he can hardly believe that it is really that simple, after writing this command, we will notice that Laravel framework automatically creates all the files that the site needs, such as login, saving files for Controller, Models, Views, Migrations and other files.

How to activate Migrations

If we want to activate Migrations, we can do so through the following command:

php artisan migrate

Thus, we have a comprehensive function that includes a login and logout, it also contains a password reset feature and a member creation feature, these functions can also be done manually using Attempt function.

Create a new project to try Attempt function

Initially, it is necessary to create a new project through Laravel framework, so that we can try Attempt function, it is possible to do using a previously prepared project, to create a new project this command must be written in the command line as follows.

laravel new ProjectName

This command will create a new Laravel project, given that Laravel has already been installed.

By using the new laravel command, if an error message appears, you must install Laravel again on your device, through the following command:

"composer global require "laravel/installer=~1.1

If you do not want to install Laravel on your computer, you can create a new project through Composer function by typing the following command on the command line:

composer create-project --prefer-dist laravel/laravel blog

After we finish installing the new project we created, we start the real work by creating a controller in order to be able to fully manage members system, we can call it AuthController through the following command on the command line:

php artisan make:controller AuthController