I have a project I'm working on right now, in which I created a database to hold some info. I've already created a view and a controller where I can add data to the DB and it works. But for some reason when I try to use on a view to list my information it won't work.
Here's my model:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Banner extends Model
{
protected $fillable = ['descricption','image'];
}
And these are the first few lines of my view which laravel point to error:
@php
use\app\Banner;
$banner = new Banner;
$banners = Banner::all();
@endphp
Whenever I try to open this view, I get the "Class 'app\Banner' not found" error. What am I doing wrong? Since it worked to add data to the database before, and I did remember of putting the use\app\Banner;