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,5 +0,0 @@
*.php
!Membership.php
!Team.php
!TeamInvitation.php
!User.php

35
app/Models/Category.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'slug',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
];
public function courses(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(Course::class);
}
}

36
app/Models/City.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class City extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'country_id',
'name',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'country_id' => 'integer',
];
public function country(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Country::class);
}
}

35
app/Models/Country.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Country extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'code',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
];
public function cities(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(City::class);
}
}

41
app/Models/Course.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Course extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'lecturer_id',
'name',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'lecturer_id' => 'integer',
];
public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(Category::class);
}
public function lecturer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Lecturer::class);
}
}

46
app/Models/Event.php Normal file
View File

@@ -0,0 +1,46 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Event extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'course_id',
'venue_id',
'from',
'to',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'course_id' => 'integer',
'venue_id' => 'integer',
'from' => 'datetime',
'to' => 'datetime',
];
public function course(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Course::class);
}
public function venue(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Venue::class);
}
}

39
app/Models/Lecturer.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Lecturer extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'team_id',
'name',
'slug',
'active',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'team_id' => 'integer',
'active' => 'boolean',
];
public function team(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Team::class);
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Participant extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'first_name',
'last_name',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
];
}

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Registration extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'event_id',
'participant_id',
'active',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'event_id' => 'integer',
'participant_id' => 'integer',
'active' => 'boolean',
];
public function event(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Event::class);
}
public function participant(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Participant::class);
}
}

38
app/Models/Venue.php Normal file
View File

@@ -0,0 +1,38 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Venue extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'city_id',
'name',
'slug',
'street',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'city_id' => 'integer',
];
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(City::class);
}
}