I am getting the following error on a laravel site:
Call to undefined method Illuminate\Database\Eloquent\Collection::useAsCallable() on line 72 of /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php
This only seems to happen on the staging server and I cannot reproduce on my local machine. I have deleted the vendor directory and completely rebuilt it via composer, cleared all caches, ran composer dump-autoload and nothing seems to resolve it.
Digging into the source I can confirm that Illuminate\Database\Eloquent\Collection
extends Illuminate\Support\Collection
and the method useAsCallable()
exists in the extended class. It is like it isnt loading it our something.
Any ideas?
Wierdly enough, I have noticed that most of such troubles from OctoberCMS arise out of 1 thing more often than not. -> FILE PERMISSIONS. This is especially true if using git to deploy.
set proper permissions: sudo chmod -R 777 octoberProject/
Then retry running the app.
Let us know if this helps.