(solved) Trying to install Wardrobe on a different database

  1. 3 years ago
    Edited 3 years ago by ionutz2k

    I'm trying to make Wardrobe to use another database.
    When I run php artisan wardrobe:migrate it says:
    [InvalidArgumentException] Database [wardrobe] not configured. wardrobe:migrate
    These are the changes that I made:

    app/config/packageswardrobe/core/database.php
    
    <?php
    
    return array(
    	'default' => 'connections',
    
    	'connections' => array(
    
    		'sqlite' => array(
    			'driver'   => 'sqlite',
    			'database' => app_path().'/database/wardrobe.sqlite',
    			'prefix'   => '',
    		),
    
    		'mysql' => array(
    			'driver'    => 'mysql',
    			'host'      => 'localhost',
    			'database'  => 'site_wardrobe',
    			'username'  => 'root',
    			'password'  => '',
    			'charset'   => 'utf8',
    			'collation' => 'utf8_unicode_ci',
    			'prefix'    => '',
    		),
    
    		'pgsql' => array(
    			'driver'   => 'pgsql',
    			'host'     => 'localhost',
    			'database' => 'database',
    			'username' => 'root',
    			'password' => '',
    			'charset'  => 'utf8',
    			'prefix'   => '',
    			'schema'   => 'public',
    		),
    
    		'sqlsrv' => array(
    			'driver'   => 'sqlsrv',
    			'host'     => 'localhost',
    			'database' => 'database',
    			'username' => 'root',
    			'password' => '',
    			'prefix'   => '',
    		),
    
    	),
    );

    Even if I change the file the error persists. If I set it to default it creates the tables on the other database, that I use for the website.
    Github Readme file says :

    If the default configuration is set to default it will use the host application connection. Otherwise, it will use the connection details listed in this connection array.

    Am I doing something wrong?

  2. Try setting default to 'mysql' and not 'connections'.

    return array(
    	'default' => 'mysql',
    
    	'connections' => array(
    
    		'sqlite' => array(
    			'driver'   => 'sqlite',
    			'database' => app_path().'/database/wardrobe.sqlite',
    			'prefix'   => '',
    		),
    
    		'mysql' => array(
    			'driver'    => 'mysql',
    			'host'      => 'localhost',
    			'database'  => 'site_wardrobe',
    			'username'  => 'root',
    			'password'  => '',
    			'charset'   => 'utf8',
    			'collation' => 'utf8_unicode_ci',
    			'prefix'    => '',
    		),
    
    		'pgsql' => array(
    			'driver'   => 'pgsql',
    			'host'     => 'localhost',
    			'database' => 'database',
    			'username' => 'root',
    			'password' => '',
    			'charset'  => 'utf8',
    			'prefix'   => '',
    			'schema'   => 'public',
    		),
    
    		'sqlsrv' => array(
    			'driver'   => 'sqlsrv',
    			'host'     => 'localhost',
    			'database' => 'database',
    			'username' => 'root',
    			'password' => '',
    			'prefix'   => '',
    		),
    
    	),
    );
  3. What a noob!
    Thank you!

or Sign Up to reply!