Closed igoralves1 closed 4 years ago
You either run php artisan voyager:install
or do the advanced steps. Not both.
I resolved this by modifying my DatabaseSeeder to include the content of the VoyagerDatabaseSeeder. Specifically:
use TCG\Voyager\Traits\Seedable;
right bellow class definition:
use Seedable;
protected $seedersPath = __DIR__.'/';
inside the run method:
$this->seed('DataTypesTableSeeder');
$this->seed('DataRowsTableSeeder');
$this->seed('MenusTableSeeder');
$this->seed('MenuItemsTableSeeder');
$this->seed('RolesTableSeeder');
$this->seed('PermissionsTableSeeder');
$this->seed('PermissionRoleTableSeeder');
$this->seed('SettingsTableSeeder');
Not sure why, but I did the installation manually as I had an already existing application.
Hi, just FYI: I had the same problem and in my case I just had to do a composer dump-autoload
before running the seeder.
if you change locale in config/app.php
Return it to
'locale' => 'en',
then
composer dump-autoload
php artisan voyager:install
i still get this error on laravel8. i installed voyager using 'php artisan voyager:install --with-dummy' now i need to run only voyager seeder but i get 'Class VoyagerDatabaseSeeder does not exist.' 'composer dump-autoload ' don't solve this problem :( note: i have 'database/seeds' folder which contain all voyager seeders
i still get this error on laravel8. i installed voyager using 'php artisan voyager:install --with-dummy' now i need to run only voyager seeder but i get 'Class VoyagerDatabaseSeeder does not exist.' 'composer dump-autoload ' don't solve this problem :( note: i have 'database/seeds' folder which contain all voyager seeders
namespace Database\Seeders;
use Seedable;
and change run
method)i still get this error on laravel8. i installed voyager using 'php artisan voyager:install --with-dummy' now i need to run only voyager seeder but i get 'Class VoyagerDatabaseSeeder does not exist.' 'composer dump-autoload ' don't solve this problem :( note: i have 'database/seeds' folder which contain all voyager seeders
- Move all voyager files from seeds to seeders
- Add to each of them
namespace Database\Seeders;
- Edit files VoyagerDatabaseSeeder.php and VoyagerDummyDatabaseSeeder.php - see https://github.com/the-control-group/voyager/pull/5093/files (you need remove
use Seedable;
and changerun
method)- Run seed again
For Laravel 8 you need to make below changes for Seeding to work :-
Add Database\Seeders namespace at top of DatabaseSeeder.php and other Seeder files :-
namespace Database\Seeders; Replace folder name seeds to seeders located at \database\ folder.
Update composer.json like below:
This worked for me, but I had to add this to my composer.json file and run composer dumpautoload
"autoload": {
"psr-4": {
.
.
.
"Database\\Seeders\\": "database/seeders/"
}
}```
if you change locale in config/app.php
Return it to
'locale' => 'en',
thencomposer dump-autoload
php artisan voyager:install
Thank you, This worked.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Version information
Description
Following instructions from the official page in the Advanced part when I run
php artisan db:seed --class=VoyagerDatabaseSeeder
I am getting an error (see below).Steps To Reproduce
Steps to reproduce the behavior:
php artisan voyager:install
php artisan vendor:publish --provider="TCG\Voyager\VoyagerServiceProvider"
ANDphp artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"
ANDphp artisan migrate
AND perform tha changes in USER class and route.When I run the next step
php artisan db:seed --class=VoyagerDatabaseSeeder
I get the follow error:Expected behavior
No error. Should have the database initialized with some basic data
Note:
If then I run
php artisan voyager:install --with-dummy
everything works good, even the command that was generating the error. Here you have the output: