Top 5 Common Issues When Using Laravel cover image

Top 5 Common Issues When Using Laravel

Oliver Sarfas • October 28, 2019

programming laravel

Laravel is coveted as the most popular PHP web framework in the world right now, and for good reason. It's got a lot going for it with it's vast ecosystem of Laravel Packages, great communities, and exemplary documentation - what isn't there to love?

Well, it turns out that a lot of people - myself included, more times than I'll openly admit - bump into some simple issues when using it. 99% are down to developer error, so I'm going to reel off a few of those now. We'll go into the more complex common issues in a later post, as they'll need more attention.

So what are the most common errors that people see when using Laravel for the first time? Let's take a look.

No Application Key Set

On a fresh laravel clone, you'll get a .env.example file. Now, if you've not used an installer CLI, you won't have generated your application key.

To generate an application key, simply run the following;

php artisan key:generate

From there your application will run as expected.

{table} not found

So you're on a page on your Laravel site, and you're getting a "table does not exist" or "table not found in database" error. This could be due to one of a few reasons. Here's the most common ones that you'll encounter when learning Laravel;

Specified key was too long

HTTP 419 Page Expired whenever submitting a form

The stream of file {{some_file}} could not be opened: failed to open stream: Permission Denied

Both commands should be run from the root of your project


Summary

These are very basic and common issues that you'll face when using Laravel. Whether that's as a new user, or a seasoned veteran. We all come across these, and there's no shame in forgetting how to fix them sometimes.

Hell, I'll probably open this exact article up next week because I've forgotten to set a csrf token somewhere, or not generated an Application Key - it happens to us all.

Next post, I'm hoping to put something together surround the Laravel Community, some of it's more prominent figures and what they're known for. If you have any requests; let me know!

O