小编Jul*_*ira的帖子

未定义表:7 错误:关系“费用”不存在

由于我是西班牙语使用者,我用西班牙语编写了收入和支出的控制器和模型;而其余的都是英文的。我手动重命名和更改了路由、控制器、迁移甚至模型。当我运行 php artisan migrate:reset 这是我的错误。

未定义的表:7 错误:关系“费用”不存在(SQL:更改表“费用”删除列“location_id”)**

我使用 psgql 和 laravel 5.3

这是我的代码:

    <?php

    namespace App;

    use Illuminate\Database\Eloquent\Model;

    class Expense extends Model
    {

        protected $fillable = ['id', 'description', 'quantity'];


        public function locations()
        {

            return $this->hasMany('App\Location');

        }
        public function icons()
        {

            return $this->hasMany('App\Icon');
        }
        public function types()
        {

            return $this->hasMany('App\Type');
        }
        public function stores()
        {

            return $this->hasMany('App\Store');
        }

    }
Run Code Online (Sandbox Code Playgroud)

移民:

    <?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateExpensesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void …
Run Code Online (Sandbox Code Playgroud)

php postgresql laravel eloquent

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

eloquent ×1

laravel ×1

php ×1

postgresql ×1