add blueprint files to git

This commit is contained in:
Benjamin Takats
2022-11-30 18:11:00 +01:00
parent 39202d2110
commit 07047d47ad
43 changed files with 2124 additions and 15 deletions

View File

@@ -1,3 +0,0 @@
*.php
!TeamFactory.php
!UserFactory.php

View File

@@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Category;
class CategoryFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Category::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'name' => $this->faker->name,
'slug' => $this->faker->slug,
];
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\City;
use App\Models\Country;
class CityFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = City::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'country_id' => Country::factory(),
'name' => $this->faker->name,
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Country;
class CountryFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Country::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'name' => $this->faker->name,
'code' => $this->faker->word,
];
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Course;
use App\Models\Lecturer;
class CourseFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Course::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'lecturer_id' => Lecturer::factory(),
'name' => $this->faker->name,
];
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Course;
use App\Models\Event;
use App\Models\Venue;
class EventFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Event::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'course_id' => Course::factory(),
'venue_id' => Venue::factory(),
'from' => $this->faker->dateTime(),
'to' => $this->faker->dateTime(),
];
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Lecturer;
use App\Models\Team;
class LecturerFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Lecturer::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'team_id' => Team::factory(),
'name' => $this->faker->name,
'slug' => $this->faker->slug,
'active' => $this->faker->boolean,
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Participant;
class ParticipantFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Participant::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'first_name' => $this->faker->firstName,
'last_name' => $this->faker->lastName,
];
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\Event;
use App\Models\Participant;
use App\Models\Registration;
class RegistrationFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Registration::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'event_id' => Event::factory(),
'participant_id' => Participant::factory(),
'active' => $this->faker->boolean,
];
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use App\Models\City;
use App\Models\Venue;
class VenueFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Venue::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'city_id' => City::factory(),
'name' => $this->faker->name,
'slug' => $this->faker->slug,
'street' => $this->faker->streetName,
];
}
}