dimanche 23 juillet 2017

Class not found when migrate old code to Laravel 5.4

I have application build on Laravel 4.2 which I want upgrade to Laravel 5.4. I know that is huge step but I want to try and gain some experience too while do this.

First problem which I get is

FatalThrowableError Class 'App\Pages' not found

In my BaseControlle.php I have this

<?php
namespace App\Http\Controllers;

use App\Http\Requests;
use Illuminate\Http\Request;
use App\Http\Requests\CountryRequest;

use App\Http\Controllers\Controller;

use App\Pages;

class BaseController extends Controller 
{
    /* @var User */
    protected static $user;

    /**
     * Setup the layout used by the controller.
     *
     */
    public function __construct()
    { 
        $pages = Pages::all(); 
    }
      ....

My Pages.php model is in App\ so I've imported it like use App\Pages;

Why I still continue to get this error?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire