3
votes

I clone a project from git.
After i run command:
- composer dump-autoload
- composer updated

File composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "zizaco/entrust": "5.2.x-dev",
        "doctrine/dbal": "^2.5",
        "intervention/image": "^2.3"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "symfony/css-selector": "2.8.*|3.0.*",
        "symfony/dom-crawler": "2.8.*|3.0.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

File evn

APP_ENV=local
APP_DEBUG=true APP_KEY=SomeRandomString
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1 DB_PORT=3306
DB_DATABASE=wicker_master
DB_USERNAME=root
DB_PASSWORD=root

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

Error:

> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize


  [Illuminate\Database\QueryException]                                                                                              
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wicker_master.about_us' doesn't exist (SQL: select * from `about_us`)  



  [PDOException]                                                                                    
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wicker_master.about_us' doesn't exist  


Script php artisan optimize handling the post-update-cmd event returned with error code 1
1
It seems like the project you copied tries to access a table in the postUpdate method. You can check that in your composer.json. For a quick fix remove the responsible line, then run composer update + php artisan migrate, then re-insert the line.Frnak
I removed it, but it isn't working.Huan Ho
I think it execute the last file migrate not run all file migrateHuan Ho
What is the error after removing it? Provide your composer.json - also ensure to remove the composer.lock. Show us your .env structure but please anonymise it.Frnak
Error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wicker_master.about_us' doesn't exist (SQL: select * from about_us). I add more file .evn and composer.jsonHuan Ho

1 Answers

1
votes

Do you have same db name created as in .env file ?
For example if you have written

DB_DATABASE=laravel

make sure you have create database named laravelfirst