lundi 30 mai 2016

Class not loading on Hosting but works on localhost - Laravel 5

I have a Laravel 5 project running perfectly on localhost. I uploaded the project to a webhost and suddenly i get an error on a simple class.

This is the error:

FatalThrowableError in HomeController.php line 20:
Fatal error: Class 'App\Blogpost' not found

The Homecontroller code is this:

<?php

namespace App\Http\Controllers;

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

class HomeController extends Controller
{

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {

        $blogposts = Blogpost::latest()->take(6)->get();

        return view('pages/start', compact('blogposts'));
    }
}

This code is pretty basic and works fine on localhost so i assume that the problem is located elsewhere, but i'm not sure where to begin searching?

For testing purposes i put all the code from Homecontroller in comments and than i just get an error on something else so the problem is situated elsewhere.

My localhost runs on MAMP with a Apache Server with PHP7 . Hosting also runs on Linux + Apache + PHP7 .

I have uploaded other laravel projects to the same server with the same configuration without any problems.

this is the link if that helps: http://dev.mayan-co.com



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire