I couldn't find something that do it in one line but...
After a search I found that works perfectly with me but if any have better solution please write it below
first refresh it
php artisan migrate:refresh --path=/database/migrations/2022_12_20_081911_create_sustainability_pages_table.php
then: seed it
php artisan db:seed --class=SustainabilityPageSeeder
I've been thinking about a similar command few months ago, because I had a specific situation in my project, like You. I decided to make a new command with two parameters:
So, at the first you should make new command:
In that file, you should have $signature and $description strings, and handle function. You have to include specified parameters (with their default values) to $signature string (because you would use some different tables and seeders in the future).After that, you should call artisan commands with these parameters from handle function. The file should look like this:
At the end, you should call new command from terminal like this:
Hope this helps! :)