基表或视图未找到错误
问题描述:
的productTable基表或视图未找到错误
public function up()
{
Schema::create('product', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('description');
$table->string('type');
$table->integer('size');
$table->integer('price');
$table->string('image')->nullable();
$table->timestamps();
});
}
当我点击提交,我得到了错误,说基础表中找不到
答
Laravel找不到表的prular形式您使用的名称,只需在您的模型上指定您的表名即可;并检查您的视图藏汉确保你的资源/查看您有一个名为successs.blade.php
public $table = "yourTableName";
+0
谢谢!它的工作:) –
+0
@DanielAsyraf :)请标记为答案,并投票了谢谢你 –
答
可能是你的表文件不在数据库中可用,因此首先添加表中 数据库。在你的模型像这样
public $table = "yourTableName";
后,在模型中定义的表
只是迁移表中您的数据库
php artisan make:migration
基于控制器代码,我可以说你传递视图名称'Success'可能是错误的给定。 如果这不起作用的解决方案,请提供您的模型+验证(如果已执行)深挖的详细信息。 –