In Laravel you can easily add 404 page because Laravel already has 404 functionality. What you have to do You have to creates a new folder “errors” in resources/views/ After that create a file name 404.blade.php and put in to…
Category: Laravel
Manual login user by Email Id in Laravel.
This blog is to help you manually login by using a URL with get parameters. As this practice is not secured and can be taken advantage by hackers so use it on your own risk. To make it a bit…
How to merge Collection in Laravel?
To merge two collection col1 and col2 we use merge() method of collection OR We can just pass those collection while declaring the collection Some Example case Sometimes we need to get different collection from same Database Table depending on…
Custom Facades in Laravel
Facades are static interface of a class to encapsulate its default arguments. First we need to define a class in app directory like app/CustomClass/NewClass.php Now we need to define a facade for this class Firstly we need to edit AppServiceProvider.php…
What are Laravel View Composer?
Sometimes we need to pass similar type of data to different view files or partials and later changing them is a pain point as you have to change every single one of them, hence to fix this issue view composers…
How to add Helper file in Laravel?
To create custom helpers.php file in laravel we need to edit composer.json file in laravel. In autoload object add the following file array:- After adding this we need to run the following command Make sure composer is installed. This will…
Laravel Group routing
For common prefixes in a url, Laravel uses url grouping. In the above route addresses abc.com/my-profile In GET and POST method you can use print GET route as :- And, POST route as:-
Cache Clear in Laravel
Laravel supports popular caching backends like Memcached and Redis out of the box. There are 4 types of Cache in Laravel which you can clear by cli:- Application Cache Route Cache Config Cache View Cache If you are using Shared…
How to create a csv file in Laravel?
Declare Header Declare Columns Get data Set Formatted data to a variable Return response Your code should look like this
How to send SMTP mail with Attachments in Laravel?
Firstly get the extension of the file to send and get the MIME TYPE for it. Use the mail function and pass the required data needed by the layout and SMTP connection protocol.