0
I’m with this mistake when listing all courses in a CRUD in Laravel
"Class 'app Course' not found"
Since there is this class, I will show in codes and images...
Controller code:
<?php
namespace app\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use app\Curso;
class CursosController
extends Controller
{
public function index(){
$registros = Curso::all();
return view('admin.cursos.index', compact('registros'));
}
}
Class code
<?php
namespace app;
use Illuminate\Database\Eloquent\Model;
class Curso extends Model
{
//
}
Thanks if you can help me, because it’s a college job!
Only error with the course model? Open the user model and compare with the course model.
– Kayo Bruno
use App Course ... App starts with uppercase letter. And in the model the namespace is App .. with uppercase letter tmb.. Look at your Komposer.json ... psr-4 .. " App ": "app/" ..
– cau
@Darleifernandozillmer About the edition, Laravel is a proper name that refers to the PHP framework. It should not be code formatting.
– Woss