Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 197 forks source link

Database [neo4j] not configured #307

Closed Izio91 closed 5 years ago

Izio91 commented 5 years ago

When I execute this command:

php artisan make:migration create_author_table

in console appear this message:

Database [neo4j] not configured.

These are my configurations:

.env

APP_ENV=local
APP_DEBUG=true
APP_KEY=
APP_TIMEZONE=UTC

LOG_CHANNEL=stack
LOG_SLACK_WEBHOOK_URL=

DB_CONNECTION=neo4j
DB_HOST=127.0.0.1
DB_PORT=7474
DB_DATABASE=neo4j
DB_USERNAME=neo4j
DB_PASSWORD=secret

CACHE_DRIVER=file
QUEUE_DRIVER=sync

database.php

<?php

return [
    'default' => 'neo4j',

    'connections' => [

            'neo4j' => [
                'driver' => 'neo4j',
                'host'   => env('DB_HOST', '127.0.0.1'),
                'port'   => env('DB_PORT', '7474'),
                'username' => env('DB_USERNAME', 'neo4j'),
                'password' => env('DB_PASSWORD', 'secret')
            ]
        ],
    ];

composer.json

{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework.",
    "keywords": ["framework", "laravel", "lumen"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.1.3",
        "laravel/lumen-framework": "5.6.*",
        "vlucas/phpdotenv": "~2.2",
        "vinelab/neoeloquent": "^1.4.6"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "phpunit/phpunit": "~7.0",
        "mockery/mockery": "~1.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}
Izio91 commented 5 years ago

Fixed, the config folder that contain database.php it was locate in app folder but it should be locate in root folder.