Base table or view not found

Posted 1 month ago by aufawibowo

I've been doing Laravel 5.7 From Scratch Part 8 Eloquent Namespacing and MVC but I encounter with

Illuminate/Database/QueryException with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel-project.projects' doesn't exist (SQL: insert into `projects` (`title`, `description`, `updated_at`, `created_at`) values (My first project, Lorem ipsum, 2019-04-19 19:30:35, 2019-04-19 19:30:35))'

I've followed every step there.. Really don't know what's going on here..

Here are some of my code

1. 2019_04_09_155410_create_project_table.php

<?php

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

class CreateProjectTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()        
    {
        Schema::create('project', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title');
            $table->text('description');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
    
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('project');
    }
}

and I got standart project model in

\app

2.


<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Project extends Model
{
    //
}

Any answers would really help thanks

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.