mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
add blueprint files to git
This commit is contained in:
3
database/factories/.gitignore
vendored
3
database/factories/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
*.php
|
||||
!TeamFactory.php
|
||||
!UserFactory.php
|
||||
30
database/factories/CategoryFactory.php
Normal file
30
database/factories/CategoryFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
||||
31
database/factories/CityFactory.php
Normal file
31
database/factories/CityFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
||||
30
database/factories/CountryFactory.php
Normal file
30
database/factories/CountryFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
||||
31
database/factories/CourseFactory.php
Normal file
31
database/factories/CourseFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
||||
34
database/factories/EventFactory.php
Normal file
34
database/factories/EventFactory.php
Normal 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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
33
database/factories/LecturerFactory.php
Normal file
33
database/factories/LecturerFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
||||
30
database/factories/ParticipantFactory.php
Normal file
30
database/factories/ParticipantFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
||||
33
database/factories/RegistrationFactory.php
Normal file
33
database/factories/RegistrationFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
||||
33
database/factories/VenueFactory.php
Normal file
33
database/factories/VenueFactory.php
Normal 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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user