Laravel – Model Class not found

Laravel 5 promotes the use of namespaces for things like Models and Controllers. Your Model is under the App namespace, so your code needs to call it like this: As mentioned in the comments you can also use or import a namespace in to a file so you don’t need to quote the full path, like this: While I’m doing a … Read more

How can I remove a package from Laravel using PHP Composer?

Composer 1.x and 2.x Running the following command will remove the package from vendor (or wherever you install packages), composer.json and composer.lock. Change vendor/package appropriately. Obviously you’ll need to remove references to that package within your app. I’m currently running the following version of Composer: Documentation Updates 26/10/2020 – Updated answer to assert command works … Read more

TokenMismatchException in VerifyCsrfToken.php Line 67

I’m assuming you added $this->middleware(‘auth’); inside the constructor of your controller to get the authentication working. In your login/register forms, if you are using {!! Form::someElement !!}, add the following line at the top as well: Or if you are using input tags inside your forms, just add the following line after <form> tag: Hope … Read more

Facebook OAuth “The domain of this URL isn’t included in the app’s domain”

This usually happens if you have entered the wrong details when you created the App in Facebook. Or have you changed a URL’s of an existing App? Can you please recheck the settings of your APP in this page? https://developers.facebook.com/apps Select the correct App and click in the edit button; Check the URLs & paths … Read more

Minimum Working Example for ajax POST in Laravel 5.3

I presume you have a basic understanding of the model-controler-view paradigm, a basic understanding of Laravel and a basic understanding of JavaScript and JQuery (which I will use for reasons of simplicity). We will create an edit field and a button which posts to the server. (This works for all versions from Laravel 5.0 to … Read more

How can I resolve “Your requirements could not be resolved to an installable set of packages” error?

Your software dependencies have an incompatible version conflict. At the same time you want to install any Laravel 4.2.x version, and “zizaco/entrust” from its master branch. And that master branch requires at least Laravel 5.0 (roughly speaking). The problem comes from the dependency on branches. It’s likely that the package zizaco/entrust once was using Laravel … Read more