How to fix the "Table 'database.teches' doesn't exist" error?
laravel, laravel-4
Solution
It tries to put the table name in the plural.
Just add
protected $table = 'tech';
In your model class Tech
Problem
Not sure why migrate is looking for 'teches' rather than the real table name 'techs'?? File: TechsTableSeeder.php ``` class TechsTableSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); Tech::create( [ 'name'=>'technology', 'description'=>'...', 'year'=>'2014' ]); } } ``` Upon php artisan db:seed --class="TechsTableSeeder", I get the following error in Terminal: [Illuminate\Database\QueryException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.teches' doesn't exist (SQL: insert into `teches` (`name`, `description`, `year`, `updated_at`, `created_at`) values (technology, ..., 2014, 2013-12-30 03:23:39, 2013-12-30 03:23:39)) Model Tech.php does exist and was auto-generated through `php artisan generate:model` `Tech` as follows: ``` class Tech extends Eloquent { protected $guarded = array(); public static $rules = array(); } ```