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

Adding a model inside a directory does not add the directory to the namespace, and includes the directory in the classname #38

Open
AlexJDG opened this issue Jul 4, 2017 · 1 comment

Comments

@AlexJDG
Copy link

AlexJDG commented Jul 4, 2017

Using the command php artisan wn:model Models/Product generates Products.php inside the Models directory as expected but does not add the \Models postfix to the namespace and sets the class name as Models/Product.

Using PHP 7.1 and Lumen 5.4

<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Models/Product extends Model {

    protected $fillable = [];

    protected $dates = [];

    public static $rules = [
        // Validation rules
    ];

    // Relationships

}
@webNeat
Copy link
Owner

webNeat commented Jul 4, 2017

Hello, please try:

php artisan wn:model Product --path="app/Models"

the name argument should be the single name of the model; the path should be specified using the --path option.

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

2 participants