PHP fatal error: Class 'schema' not found in (laravel) - php

I am trying to execute an migration in laravel, I ran the following command:
php artisan migrate
and php throw me:
PHP fatal error: Class 'schema' not found in C://.... on line 14
I am using php 5.4.17 and Laravel 4.1.*

The Composer autoloader is case sensitive, so you'll need to use Schema::... functions in your migrations, not schema::... ones.

Related

PHP Fatal error: Trait 'Illuminate\Database\Eloquent\Concerns\HasEvents' not found

I am trying to upload files to a live server, but I am getting this error.
PHP Fatal error: Trait
'Illuminate\Database\Eloquent\Concerns\HasEvents' not found in
/home/mysite/public_html/myapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php
on line 25
I am using Laravel 5.4.
Have you run the composer dump-autoload

Testing Database using laravel dusk

I am testing my laravel application using laravel dusk but the problem is that I am unable to use assertDatabaseHasfunction. When I run php artisan dusk command I got this error:
PHP Fatal error: Class 'PHPUnit_Framework_Constraint' not found in
vendor\laravel\framework\src\Illuminate\Foundation\Testing\Constraints\HasIn
Database.php on line 8
Here is my code:
$this->assertDatabaseHas('teams', [
'name' => $data['team_name'],
]);
Please check your version of phpunit:
phpunit --version
If you are are running v6 you might have trouble because it expects a namespaced class. In that case you either have to switch to an older version of phpunit, e.g. locally installed for your project and then run like this:
php vendor/bin/phpunit --version
or you might have to update your Laravel-project, which is probably more work as you might have to change parts of your code.

CouchBase class not found in laravel5

I use couchbase nosql database by ytake/laravel-couchbase package in my laravel 5.1 project
After install that package and run php artisan serve i got error :
PHP Fatal error: Class 'CouchbaseN1qlQuery' not found in /var/www/html/eee/vendor/ytake/laravel-couchbase/src/CouchbaseServiceProvider.php on line 71
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'CouchbaseN1qlQuery' not found
I had this error for a long time.
For me, the problem was that the CLI user couldn't write in the laravel.log when the couchbase client was trying to write a warning to it. Check user permissions.

Cannot redeclare class Stringy\Stringy

Fatal error: Cannot redeclare class Stringy\Stringy in D:\work\bookstrore-laravel\vendor\danielstjules\stringy\src\Stringy.php on line 5
i have this error when run EVERY laravel project.i'm using phpstorm 9.0.
and i can run it by php artisan serve in the project directory. i'm new with this and i really don't know why it's can't run on phpstorm

Class not Found: Laravel Artisan via ssh

for a Laravel 5.1 project I am trying to setup a beta version of this project on a shared hoster. Everything works fine except for artisan.
I do login through ssh and move to the Laravel project directory and the not matter what php artisan command I use I get following error:
PHP Fatal error: Class 'Illuminate\Queue\ConsoleServiceProvider' not found in /www/htdocs///vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 543
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Illuminate\Queue\ConsoleServiceProvider' not found
Any ideas on what could be wrong?
The autoloading should work correctly as the project works fine using the browser.
The steps by #manix helped me a lot:
Delete file bootstrap/cache/services.json
call composer update
run php artisan optimize

Categories