ali_254 Posted June 1, 2021 Share Posted June 1, 2021 hi... I want to show the tables with Eloquent. i create one model in folder "app" and create migratione . in file controller add this codes : <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use app\Ultimate; class HomeController extends Controller { // public function index2(Request $request,$id){ $data1=Ultimate::all(); dd($data1); return view('users')->with('id',$id); } } But at runtime, an error occurs. error : (1/1) FatalErrorException Class 'app\Ultimate' not found in HomeController.php line 19 whats problem? thanks Quote Link to comment Share on other sites More sharing options...
requinix Posted June 1, 2021 Share Posted June 1, 2021 Are you sure you put Ultimate.php in the right place? What's the code in that file? 1 Quote Link to comment Share on other sites More sharing options...
ali_254 Posted June 1, 2021 Author Share Posted June 1, 2021 1 hour ago, requinix said: Are you sure you put Ultimate.php in the right place? What's the code in that file? thanks , yes! file Ultimate.php: <?php namespace App; use Illuminate\Database\Eloquent\Model; class Ultimate extends Model { // } Quote Link to comment Share on other sites More sharing options...
requinix Posted June 1, 2021 Share Posted June 1, 2021 Oh. use app\Ultimate; Look closely. Quote Link to comment Share on other sites More sharing options...
ali_254 Posted June 1, 2021 Author Share Posted June 1, 2021 2 minutes ago, requinix said: Oh. use app\Ultimate; Look closely. Unfortunately I did not understand, what is the problem? Quote Link to comment Share on other sites More sharing options...
requinix Posted June 1, 2021 Share Posted June 1, 2021 app and App are two different things. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.