Jump to content

error class not found(elequent)


ali_254

Recommended Posts

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

Link to comment
Share on other sites

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
{
    //
}

 

error2.thumb.jpg.5f4f4968e7e34ab3bc410fb717676156.jpg

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.