lumen-generators
lumen-generators copied to clipboard
Adding a model inside a directory does not add the directory to the namespace, and includes the directory in the classname
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
}
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.