I'm using Lumen and working through a 12 month-old tutorial.
While attempting to run php artisan db:seed, I'm getting the following error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'App\Models\Quote' not found
However I created the Models sub-directory and Quote.php within that directory. Here is that code:
<?php
# app/Models/Quote.php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
final class Quote extends Model
{
}
Within database/seeds I have two files: QuoteTableSeeder.php & the default DatabaseSeeder.php. I added $this->call('QuoteTableSeeder'); to the run() method of DatabaseSeeder.php.
Here are the contents of QuoteTableSeeder.php:
<?php
# database/seeds/QuoteTableSeeder.php
use App\Models\Quote;
use Illuminate\Database\Seeder;
class QuoteTableSeeder extends Seeder
{
public function run()
{
Quote::create([
'text' => 'Success is going from failure to failure without losing your enthusiasm',
'author' => 'Winston Churchill',
'background' => '1.jpg'
]);
}
}
I have already ran composer dump-autoload which fixed a previous error but now causes the above-mentioned issue.
What am I doing wrong?