Middleware in laravel works as a platform among the request and the response. It provides the mechanism for investigating the HTTP requests which are entering into your application. For instance, middleware in laravel ensures that the user of your particular application is authenticated. If they found that the user is not authenticated, it will redirect the user to the main login page of the application.
Our first step should be DB::connection()->enableQueryLog(); After our query, it should be placed $querieslog = DB::getQueryLog(); After that, it should be placed dd($querieslog)
You can create a constants.php page in config folder if does not exist. Now you can put constant variable with value here and can use with Config::get('constants.VaribleName');
You can extend the login expire time with config\session.php this file location. Just update lifetime the value of the variable. By default it is 'lifetime' => 120. According to your requirement update this variable.
Laravel uses free feature-rich library SwiftMailer to send emails. Using the library function, we can easily send emails without too many hassles. The e-mail templates are loaded in the same way as views, which means you can use the Blade syntax and inject data into your templates.
Sessions are used to store information about the user across the requests. Laravel provides various drivers like file, cookie, apc, array, Memcached, Redis, and database to handle session data. By default, file driver is used because it is lightweight. Session can be configured in the file stored at config/session.php.
You can register service providers in the config/app.php configuration file that contains an array where you can mention the service provider class name.
First we have to create global.php file in config folder of your laravel application. I did add three variable in that file : siteTitle, pagination and tagLine. We can get global variable value on controller, view, model and anywhere.
Cross-Site Request Forgery (CSRF) is a type of attack that performed by the attacker to send requests to a system with the help of an authorized user who is trusted by the system.
Service providers in laravel application is the central place where application is bootstrapped. That is, laravel’s core services and our application’s services, classes and their dependencies are injected in service container through providers.
Laravel is a popular development platform that is well known for performance and the active user community. Out of the box, Laravel is pretty secure. However, no framework could claim to be 100% secure, and there are always ways to improve the security of the Laravel apps.