当我try 使用Laravel 5将数据保存到mysql时,我遇到了这个错误,其他表单和save()方法都可以正常工作,但这一个:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sistemal5.cotizacions' doesn't exist (SQL: insert into `cotizacions` (`customer_id`, `total`, `updated_at`, `created_at`) values (1501, 150.69, 2015-05-11 03:16:25, 2015-05-11 03:16:25))
以下是我的控制器存储方法:
public function store(CotFormRequest $request)
{
$quote = new Cotizacion;
$quote->customer_id = Input::get('data.clientid');
$quote->total = Input::get('data.totalAftertax');
$quote->save();
}
这是我的模型:
<?php namespace App\Models\Cotizacion;
use Illuminate\Database\Eloquent\Model;
class Cotizacion extends Model {
}
我一定忽略了一些非常明显的事情,因为我不明白拉雷维尔为什么要加上一个"S",这张桌子是合作的,而不是合作的.
我如何解决这个问题?