nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.57k stars 970 forks source link

The command `php artisan module:make-factory` generate double namespace separator #1985

Open semsphy opened 1 week ago

semsphy commented 1 week ago

Versions:

Description:

The command php artisan module:make generate double namespace separator.

Steps To Reproduce:

Actual Content

Generated double separators protected $model = \Custom\Modules\Blog\Models\\Post::class;

<?php

namespace Modules\Custom\Blog\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

class PostFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     */
    protected $model = \Custom\Modules\Blog\Models\\Post::class;

    /**
     * Define the model's default state.
     */
    public function definition(): array
    {
        return [];
    }
}

Expected Content

Generated protected $model = \Custom\Modules\Blog\Models\Post::class;, ONLY one single separator.