Laravel class not found (works on localhost, but not on DO server)

This is a repeating question - for example: Laravel 4 migrations - class not found

However, I tried every solution (from every forum I could find) and cannot figure it out.

Scenario

I created a Laravel 4 project on my local machine - added several classes, controllers, views, etc. - The project works great.

Then I copy this new repo to my DO server - install dependencies with the composer, etc. The project looks good, except for one page that gives an error message:

Class 'company' not found
Symfony\Component\Debug\Exception\FatalErrorException/­vendor/­laravel/­framework/­src/­Illuminate/­Database/­Eloquent/­Model.php593

You can view this page here .

I tried...

. "-". " " "" composer.json(, ).

"psr-4" "psr-0" composer.json - .

, , , DO... , , -, , .

:)


composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.0.*"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}
+6
6

( ), Windows, - Linux. , class company company.php , company.php , Linux , , company.php company.php .

, , company.php, , , , company not company (lower), windows c c Linux/Unix - .

+19

, / Follower_Group , , , . :

  1. composer dump-autoload .
  2. 2 /bootstrap /vendor/composer .
+6

git

:

git config core.ignorecase false

git config --global core.ignorecase false .

0

, , .

.

, 0 , , .

0

Run the command composer dump-autoloadin the local terminal of the computer, and then reload the composer folder from the provider on the local computer to your server.

0
source

THIS WORKS FOR ME → on your live server do: composer installThis should install all the necessary packages that are missing.

Hope this helps someone!

0
source

Source: https://habr.com/ru/post/1534767/


All Articles