Guidelines

This site is for tech Q&A. Please keep your posts focused on the subject at hand.

Ask one question at a time. Don't conflate multiple problems into a single question.

Make sure to include all relevant information in your posts. Try to avoid linking to external sites.

Links to documentation are fine, but in addition you should also quote the relevant parts in your posts.

0 votes
188 views
188 views

Presently, I am attempting to perform my first migration on a PHP Laravel website I am creating. I have created a user:

MariaDB [ (none) ]> CREATE USER 'homestead'@'localhost' IDENTIFIED BY 'secret';

Then I have added a CreateDatabaseCommand as explained here:

https://stackoverflow.com/questions/36914573/how-to-create-new-empty-database-with-laravel-over-model

But when I try to execute the command it fails:

ubuntu@ip-123-342-112-224:/var/www/mywebsite$ ./artisan make:database ledca

   Illuminate\Contracts\Container\BindingResolutionException 

  Target class [App\Console\CreateDatabaseCommand] does not exist.

  at vendor/laravel/framework/src/Illuminate/Container/Container.php:916
    912▕ 
    913▕         try {
    914▕             $reflector = new ReflectionClass($concrete);
    915▕         } catch (ReflectionException $e) {
  ➜ 916▕             throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
    917▕         }
    918▕ 
    919▕         // If the type is not instantiable, the developer is attempting to resolve
    920▕         // an abstract type such as an Interface or Abstract Class and there is

      +10 vendor frames 

  11  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()
in Sysadmin
edited by
by (10)
2
edit history

Please log in or register to answer this question.

1 Answer

0 votes

Removed the command from Kernel.php, then executed these commands:

php artisan cache:clear
php artisan config:clear
by (10)
2
edit history
...