Column not found: 1054 Unknown column laravel

前端 未结 2 1432
挽巷
挽巷 2021-02-18 21:31

so i trying to make a form with laravel but other than in new version they removed form ! but i can get this running

so here is is :

Route::post(\'/reg         


        
相关标签:
2条回答
  • 2021-02-18 22:16

    This is happens because Laravel assumes you want to use the updated_at and created_at timestamps for your models. So it also assumes they exist in the database. You can either create the two columns or disable timestamps for your model by adding

    public $timestamps = false;
    

    Laravel Docs

    By the way: If you're using migrations, adding the timestamp columns is a breeze.

    Schema::table('table_name', function(Blueprint $table){
        $table->timestamps();
    }
    
    0 讨论(0)
  • 2021-02-18 22:29

    This did the trick for me.

         $table->timestamp('created_at')->nullable();
            $table->timestamp('updated_at')->nullable();:
    

    Then reset your migrations

        php artisan migrate:reset
        php artisan migrate
    
    0 讨论(0)
提交回复
热议问题