laravel-fullcalendar icon indicating copy to clipboard operation
laravel-fullcalendar copied to clipboard

Class laravel-fullcalendar does not exist

Open ghost opened this issue 8 years ago • 3 comments

I followed your docs and got the error Non-static method addevents should not be called statically... Referring to issue #15 I used the Facades Class and it then gives me the error "Class laravel-fullcalendar does not exist" Do you have an advice for that?

Thanks!

ghost avatar Feb 27 '16 23:02 ghost

if u r using L.5 u should add the

use MaddHatter\LaravelFullcalendar\Facades\Calendar;

or inside ur code use it as \Calendar::xxx(); to call it from the main route.

https://github.com/maddhatter/laravel-fullcalendar/issues/31

ctf0 avatar Mar 20 '16 09:03 ctf0

I have the same error, but the problem seems to be not fixed.

I have the Service Provider and the Facade in app.php.

This is my controller:

namespace App\Http\Controllers\Admin;

use App\Lesson;
use App\Http\Requests;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use MaddHatter\LaravelFullcalendar\Facades\Calendar;

class CalendarController extends Controller
{
    public function index()
    {
        $calendar_events = Lesson::all();
        return view('admin.calendar', ['calendar' => Calendar::addEvent($calendar_events)]);     
    }
}

I don't understand the reason of this error. I tried to use \Calendar without the "use" line, MaddHatter\LaravelFullcalendar\Facades\Calendar directly, the error it is always there.

J03Bukowski avatar Jul 24 '16 20:07 J03Bukowski

I noticed that I started having the same problem with all the new installed packages. I resolved in this way:

  1. composer dump-autoload
  2. php artisan cache:clear
  3. php artisan config:clear

J03Bukowski avatar Jul 26 '16 15:07 J03Bukowski