Laravel Call to undefined method App\Exceptions\Handler::unauthenticated()

If you are facing problem in Laravel Call to undefined method App\Exceptions\Handler::unauthenticated(), this post might be helpful for you. It happens because unauthenticated function somehow missing from error handler.

Go to App\Exceptions\Handler.php file and add the following function.


Make sure top of your class, you have used use

Illuminate\Auth\AuthenticationException as AuthenticationException;



How to upload laravel in cPanel

Often you might be able to face this problem. Today, I am showing you how to upload laravel in cPanel. Of course, there are few ways to upload laravel project in cpanel. However, this post shows you by modifying .htaccess file.

Upload your entire files and folder to your cPanel. After successfully uploading, if you want to access that url (i.e. you might able to see a list of directory and files. Isn’t that?

If so, create a .htaccess file into your main directory and write following line of code.

Now, save your file and run. Hope it will work.


Laravel Carbon Display Local Dates and Time

If you use laravel and want to make it localized your date time, I think Laravel Carbon Display Local Dates and Time will help you to achieve.

Now based on your requirement, you can assign any place name that you want.




Laravel Prevent Disposable Emails

If you are looking for Laravel Prevent Disposable Emails, I think this post can be helpful. I discovered one of the packages for that called EmailChecker.

How to Install

Install Via Composer:

composer require mattketmo/email-checker


How to Use

Use as providers and aliases inconfig/app.php –




'EmailChecker' => EmailChecker\Laravel\EmailCheckerFacade::class


Access Via Facade:

Access Via Container:

Make sure you have used top of your controller.

use EmailChecker


By default, this package already added more than 2k domains. If you need to add more domain to that list, just search the file name throwaway_domains.txt and add the domain that you want to prevent.

Lumen vs Laravel performance in 2018

If you are planning to choose the right framework for your next project, I think Lumen vs Laravel performance comparison is really helpful for you. Laurence did that comparison in Medium. For your better understanding, I have just repost this article.

I ran an Apache Benchmark test against each route for Laravel (web), Laravel (api) and Lumen. I then re-ran those tests for a total of 5 rounds (as I found the tests results fluctuate by as much as 10% each round) and then averaged the results.


Using Laravel Translation Strings in Vue.js

I found one of the interesting tutorials for Laravel Translation with VueJS. This post is just providing Jeff Madsen‘s post here for my readers.

One issue you will face if you need to make a multi-lingual site is how to keep your translations organized for both your back-end framework and your javascript components. I’m going to demonstrate the basic technique for this, using Laravel and Vue.js for my example.

What is this?

You should know right off the bat that the technique I’m showing is completely framework — and even language — agnostic. The idea behind it would work just as well for a .Net app fronted with Ember.js, for example.

I’m writing this at two levels, so you are free to read according to what you need to get out of this. If you are simply looking for a solution for your Laravel and Vue app, go ahead and look at the code boxes. If you read the paragraph above about .Net and are scratching your chin, we’ll explain a little deeper what we are actually doing in addition to working with the code libraries themselves.

Laravel DOMDocument() class not found

If you are using DOMDocument class in Laravel, you might be facing this problem that Laravel DOMDocument() class not found. It’s because, in laravel 5, you must prefix the class name with the global namespace prefix ‘\’.

A sample code is given below.



Laravel Full Text Search

It’s often required to make a full-text search in your table. However, the concept is not that easy to understand. In this tip, I will show you how to do search full-text in laravel for 1 or more than 1 column.

Database table setup:

Need to change table structure a bit in order to implement full-text.



In general, we can write a code to search data based on any specific keyword. That’s fine. However, our aim to search data and return a result based on most equivalent results.

In raw PHP-MySq

This query brings records based on search string from the database. Now in Laravel, you can write this query-

This one also brings the same result. Nice.

What if you need to get results based on matching score in a descending way? Well, you can do that too.

Obviously, you can apply more logic here.