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

[9.x] Fix artisan make:seeder command nested namespace and class name problem #41534

Merged
merged 4 commits into from
Mar 17, 2022

Conversation

m-mohammadi1
Copy link
Contributor

Personally I used to structure my seeders for different parts like Auth part (for rules, permissions and users) and etc ...
but when I use

php artisan make:seeder Auth/Permissions/SomePermissionSeeder

The result is like this:

<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class Auth/Permissions/SomePermissionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
    }
}

and as you can see the namespace and class name are not correct.
after the change the result will be like this:

<?php

namespace Database\Seeders\Auth\Permissions;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class SomePermissionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
    }
}

I have changed the make:seeder command class and you can see it.
And then we can structure our seeders with artisan console command with right namespace and class name.

@m-mohammadi1 m-mohammadi1 changed the title fix artisan make:seeder command nested namespace and class name problem [9.x] fix artisan make:seeder command nested namespace and class name problem Mar 17, 2022
@m-mohammadi1 m-mohammadi1 changed the title [9.x] fix artisan make:seeder command nested namespace and class name problem [9.x] Fix artisan make:seeder command nested namespace and class name problem Mar 17, 2022
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

Successfully merging this pull request may close these issues.

2 participants