Skip to content

Commit

Permalink
for l8
Browse files Browse the repository at this point in the history
  • Loading branch information
summerblue committed Dec 18, 2020
1 parent 4b503ed commit f9882d6
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -38,4 +38,4 @@
]
}
}
}
}
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```
Expand Down
21 changes: 15 additions & 6 deletions src/Stubs/factory.stub
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<?php

use Faker\Generator as Faker;
namespace Database\Factories;

$factory->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,
];
}
}
1 change: 1 addition & 0 deletions src/Stubs/migration.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

Expand Down
4 changes: 4 additions & 0 deletions src/Stubs/model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;

class {{Model}} extends Model
{
use HasFactory;

protected $fillable = [{{fillable}}];
}
2 changes: 2 additions & 0 deletions src/Stubs/seed.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\{{Model}};

Expand Down

0 comments on commit f9882d6

Please sign in to comment.