Search code examples
classlaravel-5modelweb-deploymentshared-hosting

laravel app class not found after deployment


Please, Be indulgent, this is my first question here... ;)

After deploying a Laravel 5.4 site on a shared server, the following error appears:

Class 'App\Langue' not found

And it appears for each of my class. Everything is functional except the pages where I call a class.

Here is my code:

One of my Controller:

<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App;
use App\Langue;
use App\Formation;
use Carbon\Carbon;

class FormationController extends Controller
{
    public function index() {

        $langueId = Langue::where('raccourci', App::getLocale())
                          ->select('id')
                          ->first();

...}

One of my class (Model):

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Session;

use App;

class langue extends Model
{
    public function coaches() {
        return $this->hasMany('App\Coach');
    }


    public static function keepOldLanguage() {
        Session::put('oldLanguage', App::getLocale());
    }
}

Here is the tree view of my files

  • mydomain
    • app
    • public_html
    • vendor
    • ...

Here's what I've tried so far:

  1. php composer.phar clearcache
  2. php composer.phar dump-autoload (with and without -o)
  3. php composer.phar update
  4. php composer.phar install
  5. change uppercase and lowercase for my class
  6. Check if my class is in file autoload_classmap.php (and Yes it is: 'App\langue' => $baseDir . '/app/langue.php', )
  7. and many other things...

Local OS: Windows 10

Maybe it's just a detail, but please, help me

*PS1: As you may have noticed, this is the first time I have deployed a site in Laravel.

PS2: if information is missing, please ask for it...*


Solution

  • i think u use lower case in model language and upper case in controller Language check it