Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

laravle 5.5 - laravel 7 No Ddatabase/seeders folder #179

Open
luckilyh opened this issue Jan 11, 2021 · 9 comments
Open

laravle 5.5 - laravel 7 No Ddatabase/seeders folder #179

luckilyh opened this issue Jan 11, 2021 · 9 comments

Comments

@luckilyh
Copy link

An error was reported during "php aritsan iseed admin_menu" execution
file_put_contents(/var/www/laravel/database/seeders/AdminMenuTableSeeder.php): failed to open stream: No such file or directory

Laravel 7 The following folder is Database /seeds, so the above error is reported

The Laravel 8 folder is Database/Seeders

@aomini
Copy link

aomini commented Jan 13, 2021

I've stopped using larvel since a year ago. So, for now I will suggest you to check you namespace inside of your seeder file. Casing also matters.

@dev7771
Copy link

dev7771 commented Jan 14, 2021

@luckilyh you can change it in config

@sprklinginfo
Copy link

Laraavel 7 project. I copied the config file from 'src' and changed the path line to "'path' => '/database/seeds'" which fixed 'no such file or directory' error. but it has this 'namespace Database\Seeders;' in the file which caused this error:

`Illuminate\Contracts\Container\BindingResolutionException

Target class [IseedRolesTableSeeder] does not exist.
`

@dev7771
Copy link

dev7771 commented Jan 19, 2021

Laraavel 7 project. I copied the config file from 'src' and changed the path line to "'path' => '/database/seeds'" which fixed 'no such file or directory' error. but it has this 'namespace Database\Seeders;' in the file which caused this error:

`Illuminate\Contracts\Container\BindingResolutionException

Target class [IseedRolesTableSeeder] does not exist.
`

First run composer dump autoload and then
Change all seeders namespace in DatabaseSeeeder.php like that:

$this->call(\Database\Seeders\IseedRolesTableSeeder::class);

@jonnymccullagh
Copy link

I created a symbolic link
ln -s ./seeds ./seeders
seems to have worked thus far

@jonjieviduya
Copy link

@turanzamanli how can we change it in config? I think this package doesn't have any configuration file that we can modify.

@iwasherefirst2
Copy link

@jonjieviduya if you create a file config/iseed.php manually with the content

<?php
return [
    'path' => '/database/seeds',
    'chunk_size' => 500 // Maximum number of rows per insert statement
];

it will overwrite the values from vendor config. The usual publish:config command that is used in most packages is not working here, because the config has not been registered in the ServiceProvider. So you simply have to create the config manually.

@MmKargar
Copy link

MmKargar commented Nov 6, 2021

For laravel 5 , 6 , 7 just use orangehill/iseed": "^2.6.3 and every thing is ok🥇
No need to change nothing .

@digitcreators
Copy link

in Laravel-7
simply create a folder called seeder inside database folder and then run
php artisan iseed your_table_name --classnamesuffix=Your_Suffix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants