flipboxstudio / lumen-generator

A Lumen Generator You Are Missing
https://packagist.org/packages/flipbox/lumen-generator
MIT License
824 stars 126 forks source link

Set the correct model directory for the make:model command in Lumen 8 #98

Closed jorgemudry closed 3 years ago

jorgemudry commented 3 years ago

What does this Pull Request Do?

It fixes the issue https://github.com/flipboxstudio/lumen-generator/issues/96

How should this be manually tested?

  1. Add the fork to your composer.json file:
    "require": {
        "php": "^7.3|^8.0",
        "laravel/lumen-framework": "^8.0",
        "flipbox/lumen-generator": "dev-fix_model_creation_path"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/jorgemudry/lumen-generator"
        }
    ]
  1. Install the package:
$ composer update flipbox/lumen-generator;
  1. Use the make:model command:
$ php artisan make:model Account
  1. You should end up with an Account.php model in your app/Models directory looking like this:
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Account extends Model
{
    //
}

Any background context you want to provide?

With the new version 8 of Lumen (and Laravel) models get created inside of the app/Models directory.

Any extra info?

mother