Added About Page
This commit is contained in:
22
database/factories/TourDayFactory.php
Normal file
22
database/factories/TourDayFactory.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Tour;
|
||||
use App\Models\TourDay;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class TourDayFactory extends Factory
|
||||
{
|
||||
protected $model = TourDay::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'tour_id' => Tour::whereInternalName('hebei_harmony')->first()->id,
|
||||
'description' => $this->faker->sentence(),
|
||||
'content' => $this->faker->paragraphs(3, true),
|
||||
'image' => $this->faker->imageUrl(800, 600, 'travel', true, 'Tour Day'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tour_days', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('tour_id')
|
||||
->constrained('tours')
|
||||
->onDelete('cascade');
|
||||
$table->string('description')->nullable();
|
||||
$table->text('content')->nullable();
|
||||
$table->string('image')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tour_days');
|
||||
}
|
||||
};
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\TourDay;
|
||||
use App\Models\User;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
@@ -13,7 +14,7 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
User::factory(10)->create();
|
||||
$this
|
||||
->call(ContinentSeeder::class)
|
||||
->call(CountrySeeder::class)
|
||||
@@ -21,6 +22,8 @@ class DatabaseSeeder extends Seeder
|
||||
->call(TourCountrySeeder::class)
|
||||
;
|
||||
|
||||
TourDay::factory()->count(5)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
|
||||
Reference in New Issue
Block a user