-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found #944
Comments
same here temporary fix until things are resolved in Builder.php line 94: /**
* Create a new query builder instance.
*
* @param Connection $connection
* @param Processor $processor
*/
public function __construct(Connection $connection, Processor $processor)
{
$this->grammar = new Grammar;
$this->connection = $connection;
$this->processor = $processor;
//$this->useCollections = version_compare(\Illuminate\Foundation\Application::VERSION, '5.3', '>=');
$this->useCollections = true;
} |
if it helps speed things up @jenssegers it looks like instead of that constant there is a an $app->version() function for Lumen (which is what I'm using) |
@acidjazz @jenssegers when using this outside laravel framework, the version compare of laravel framework is not required so it's best to put inside a condition if (class_exists('\\Illuminate\\Foundation\\Application')) {
$this->useCollections = version_compare(\Illuminate\Foundation\Application::VERSION, '5.3', '>=');
} else {
$this->useCollections = true;
} |
@JetSynthesys thanks, why is that though? why does returning collections only exist in 5.3 now but in Lumen it was always OK? |
It looks like PR #948 seems to address this, if you look at the addition |
For Lumen you can add to your bootstrap next rows as temporary solution: if (!class_exists('\Illuminate\Foundation\Application')) {
class_alias(\App\Application::class, '\Illuminate\Foundation\Application');
} Create Application class in const VERSION = "5.3"; |
@GreenLamantin I would say @morrislaptop 's change is the most sound in #948 so far since he's still actually checking for the version |
@GreenLamantin i had try used your idea, this good Thanks. |
i need help on the following issue: |
Hi,
Earlier I was using dev-master branch which was supporting new MongoDB drivers. Recently i updated it to 3.1-alpha and 3.0 version but am getting this Uncaught Error for class 'Illuminate\Foundation\Application'. Before update this was working fine and now its breaking entire thing. I am using this outside laravel framework.
Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /var/www/jetmetrix_new/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php:99 Stack trace: #0 /var/www/jetmetrix_new/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Eloquent/Model.php(536): Jenssegers\Mongodb\Query\Builder->__construct(Object(Jenssegers\Mongodb\Connection), Object(Jenssegers\Mongodb\Query\Processor)) #1 /var/www/jetmetrix_new/vendor/illuminate/database/Eloquent/Model.php(1831): Jenssegers\Mongodb\Eloquent\Model->newBaseQueryBuilder() #2 /var/www/jetmetrix_new/vendor/illuminate/database/Eloquent/Model.php(1801): Illuminate\Database\Eloquent\Model->newQueryWithoutScopes() #3 /var/www/jetmetrix_new/vendor/illuminate/database/Eloquent/Model.php(3513): Illuminate\Database\Eloquent\Model->newQuery() #4 /var/www/jetmetrix_new/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Eloquent/Model.php(553): Illuminate\Database\Eloquent\Model->__call('where', Array) #5 /var/www/jetmetrix_new/lib/JetMetrix.php(3926): Jensseg in /var/www/jetmetrix_new/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php on line 99
The text was updated successfully, but these errors were encountered: