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;
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. example.com) 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.
If you use Git each and every single day, this post might be helpful for you. I write this post for my personal preference as well.
Push commit to another Branch
If you are on a development team where there is more than 1 developer, you might need your personal branch to update your work. In this case, you need to know how to push the commit to another branch.
You need to specify the source ref and the target ref:
git push origin branch1:branch2
git push <remote> <branch with new changes>:<branch you are pushing to>
I will show you the simplest way that how to set crontab job in Macbook. Let’s see here.
How to use?
Go to terminal, and write following line, then hit enter.
env EDITOR=nano crontab -e
Now you are able to write your cron instructions. Just add whatever you want. I am showing you one example-
* * * * * cd ~/my/backup/folder && ./backup.sh
How to use URL?
Well, if you need to use url in cron job, here are the ways-
Use curl to fetch the data.
* * * * * curl http://localhost/your/url
You can use wget for that.
* * * * * wget http://localhost/your/url
Now save your crontab.
How to see the list of the Cron job?
Just write following line of code in terminal and hit enter.
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.
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 in
'EmailChecker' => EmailChecker\Laravel\EmailCheckerFacade::class
Access Via Facade:
Access Via Container:
Make sure you have used top of your controller.
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.
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.
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.
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.
This tips, I will show you how to get all the POSTS of a category in WordPress. Imagine that, you have a category called PHP and you want to display all the post belongs to PHP. Here is the code-
Here in args category value is 1. That means you have to replace your category id.
In Laravel, it’s confusing to use groupby and orderby together. Today, I will show you a little trick, so that you can easily use that.