Follow laravel upgrade guide
This commit is contained in:
parent
57186c3e2e
commit
ed54446f87
37 changed files with 412 additions and 259 deletions
|
@ -2,10 +2,8 @@
|
|||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Support\Carbon;
|
||||
use App\Models\{Bookmark, Tag};
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BookmarksTableSeeder extends Seeder
|
||||
{
|
||||
|
@ -16,17 +14,8 @@ class BookmarksTableSeeder extends Seeder
|
|||
*/
|
||||
public function run()
|
||||
{
|
||||
Bookmark::factory(10)->create();
|
||||
factory(Bookmark::class, 10)->create()->each(function ($bookmark) {
|
||||
$bookmark->tags()->save(factory(Tag::class)->make());
|
||||
|
||||
$now = Carbon::now()->subDays(rand(2, 12));
|
||||
DB::table('bookmarks')
|
||||
->where('id', $bookmark->id)
|
||||
->update([
|
||||
'created_at' => $now->toDateTimeString(),
|
||||
'updated_at' => $now->toDateTimeString(),
|
||||
]);
|
||||
});
|
||||
Bookmark::factory(10)
|
||||
->has(Tag::factory()->count(1))
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue