From f9882d67163c3eb74afbf9c62812633376154e78 Mon Sep 17 00:00:00 2001 From: Summer Date: Fri, 18 Dec 2020 11:25:12 +0800 Subject: [PATCH] for l8 --- composer.json | 6 +++--- readme.md | 6 ++++++ src/Stubs/factory.stub | 21 +++++++++++++++------ src/Stubs/migration.stub | 1 + src/Stubs/model.stub | 4 ++++ src/Stubs/seed.stub | 2 ++ 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index c566930..db0b803 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ "php": ">=7.0.0" }, "require-dev": { - "phpunit/phpunit": "^8.0", - "laravel/laravel": "7.*" + "phpunit/phpunit": "^9.3.3", + "laravel/laravel": "8.*" }, "autoload": { "psr-4": { @@ -38,4 +38,4 @@ ] } } -} +} \ No newline at end of file diff --git a/readme.md b/readme.md index 018c912..76e8793 100644 --- a/readme.md +++ b/readme.md @@ -10,6 +10,12 @@ Laravel Scaffold Generator, for Laravel 5.3. ### Step 1: Install Through Composer +8.x: + +``` +composer require "summerblue/generator:8.*" --dev +``` + 7.x: ``` diff --git a/src/Stubs/factory.stub b/src/Stubs/factory.stub index ce5e577..25f6dbf 100644 --- a/src/Stubs/factory.stub +++ b/src/Stubs/factory.stub @@ -1,9 +1,18 @@ define(App\Models\{{Model}}::class, function (Faker $faker) { - return [ - // 'name' => $faker->name, - ]; -}); +use App\Models\{{Model}}; +use Illuminate\Database\Eloquent\Factories\Factory; + +class {{Model}}Factory extends Factory +{ + protected $model = {{Model}}::class; + + public function definition() + { + return [ + // $this->faker->name, + ]; + } +} diff --git a/src/Stubs/migration.stub b/src/Stubs/migration.stub index 6c1eadc..0e6d763 100755 --- a/src/Stubs/migration.stub +++ b/src/Stubs/migration.stub @@ -1,5 +1,6 @@