123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace Database\Seeders;
- use Illuminate\Database\Seeder;
- use App\Models\Loan;
- use Carbon\Carbon;
- class LoansSeeder extends Seeder
- {
- /**
- * Run the database seeds.
- *
- * @return void
- */
- public function run() {
- Loan::create([
- 'user_id' => 2,
- 'book_id' => 1,
- 'start' => Carbon::now()->format('Y-m-d'),
- 'end' => Carbon::now()->format('Y-m-d')
- ]);
-
- Loan::create([
- 'user_id' => 3,
- 'book_id' => 2,
- 'start' => Carbon::now()->format('Y-m-d'),
- 'end' => null
- ]);
-
- Loan::create([
- 'user_id' => 4,
- 'book_id' => 3,
- 'start' => Carbon::now()->format('Y-m-d'),
- 'end' => Carbon::now()->format('Y-m-d')
- ]);
-
- Loan::create([
- 'user_id' => 4,
- 'book_id' => 4,
- 'start' => Carbon::now()->format('Y-m-d'),
- 'end' => Carbon::now()->format('Y-m-d')
- ]);
-
- Loan::create([
- 'user_id' => 5,
- 'book_id' => 5,
- 'start' => Carbon::now()->format('Y-m-d'),
- 'end' => null
- ]);
-
- Loan::create([
- 'user_id' => 5,
- 'book_id' => 6,
- 'start' => Carbon::now()->format('Y-m-d'),
- 'end' => Carbon::now()->format('Y-m-d')
- ]);
- }
- }
|