Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Zoul's avatar
Level 5

Base table or view not found: 1146 Table 'db.about' doesn't exist

Hi all, i had a migration file named about, then i deleted manually and created another one named abouts which triggered the above error, i searched everywhere in project there is nothing calling about table. i stoped the AppServiceProvider boot method to make sure nothing is running just in case, and also ran many times php artisan make:refresh/fresh but still the same Any idea what is going wrong pls ?

0 likes
14 replies
Tray2's avatar

You really should follow the naming conventions it will make your life easier.

Check your About model and see if you have specified table about. in it.

Give this a read https://tray2.se/posts/sqlerrm

2 likes
Zoul's avatar
Level 5

I appreciate your help @Tray2 ! and thanks for sharing this link.

According to the link provided, the migration file should also be in plural or separate by underscore its composed of tow words. As i noticed i was nameing my migration about and not abouts, i thought it would be good to stay consistent, and since also i upgraded to laravel 11, there is a slight change in migration file naming method. I deleted both migration file ( about) and model About and created them using php artisan make:model About -m which created migration file(abouts)

In About model i'm not calling the old migration file table

class About extends Model
{
    use HasFactory;
    use HasTranslations;  
    

    protected $fillable = ['title','description','meta_description','photo','status','p1','p2','p3','p4','p5'];
    protected $table = 'abouts';    
    public $timestamps = true;
    public $translatable = ['title','description','meta_description','p1','p2','p3','p4','p5'];

    public function getPhotoAttribute($val)
    {
         return $val ? asset('storage/images/about/'.$val) : ''; 
    }

}
1 like
Tray2's avatar

@Zoul yes table names should always be plural except when it comes to pivot tables.

This is a really good practice php artisan make:model About -m, and if you follow the conventions you don't have to set the `$table property, it is assumed.

Zoul's avatar
Level 5

@Tray2 This is what i should be following from now on.

I could successfully do CRUD when i created migration file named about, despite all data stored in abouts migration file, although i'm not using about mgiration and data are not stored in it, i don't why it has be created to avoid the error and also i searched the whole project i could find where its calling this about migration file.

Zoul's avatar
Level 5

@Tray2 thanks a lot for sharing this course, i will try to take this course to get deeper insight about eloquent

Snapey's avatar
Snapey
Best Answer
Level 122

Do you have a validation rule that is checking if a record exists in the about table ?

Validation does not use eloquent models so if the table name changes, your validation code will break unless you change it there also.

Zoul's avatar
Level 5

Many thanks @Snapey - two days looking for the solution and have not thought of the validation file at all : ) i appreciate your help

Zoul's avatar
Level 5

Thank you so much y'all for your help and support

dkroft's avatar

For future consideration, another place to check are foreign keys and relationships -- database may have captured a foreign key reference from "another table" back to the table that no longer exists.

1 like
Zoul's avatar
Level 5

Many thanks for your tips @dkroft , i will take that into account when facing this kind of issue. Cheers

Please or to participate in this conversation.