Support the ongoing development of Laravel.io →
posted 7 years ago
Session
Last updated 1 year ago.
0

This error shows up when the dependency injector fails to instantiate a dependency class. probably if you scroll down more there should be another exception, which is causing this exception. Or your HomeController is not registered properly, is the namespace correct ?

0

The namespace ist correct, because that is exactly the Path namespace "app\Http\Controllers". For what reason the Homecontroller ist not registerd properly and how can i fix that?

what phpstorm tells me is when i move with my mouse to the word route. "undefind class. but the pass i typed in is correct.

Last updated 7 years ago.
0

can i see your Homecontroller, formatted ?

Last updated 7 years ago.
0
<?php namespace app\Http\Controllers; use Auth; use app\Models\Status; class HomeController extends Controller { public function index() { if (Auth::check()) { $statuses = Status::notReply() ->where( function($query) { return $query->where('user_id', Auth::user()->id) ->orWhereIn('user_id', Auth::user()->friends()->lists('id')); }) ->orderBy('created_at', 'desc') ->paginate(10); return view('timeline.index') ->with('statuses', $statuses); } return view('home'); } }
0

looks okay, try running composer dump-autoload, or composer dump-autoload with -o, probably composer can't find your controller class,

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Sko007 sko007 Joined 1 Jan 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.