Upgrade to Laravel 8
This commit is contained in:
parent
1ad58f10c5
commit
57186c3e2e
27 changed files with 945 additions and 1003 deletions
|
@ -1,14 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Note;
|
||||
use Faker\Generator as Faker;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
$factory->define(Note::class, function (Faker $faker) {
|
||||
$now = Carbon::now()->subDays(rand(5, 15));
|
||||
return [
|
||||
'note' => $faker->paragraph,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
];
|
||||
});
|
||||
class NoteFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Note::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$now = Carbon::now()->subDays(rand(5, 15));
|
||||
|
||||
return [
|
||||
'note' => $this->faker->paragraph,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue