zwischencommit

This commit is contained in:
Nils Bonorden committed 2025-10-28 21:51:43 +01:00
1 parent bdb62a6ce2
commit ed07d3ef70
8 files changed
+263 -5

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Band extends Model
{
use HasFactory;
protected $fillable = [
'name',
'email',
'phone',
'city',
'website',
'spotify',
'instagram',
'youtube',
'about',
'tech_rider_path',
'stage_plan_path',
];
public function applications()
{
return $this->hasMany(BandApplication::class);
}
}
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BandApplication extends Model
{
use HasFactory;
protected $fillable = [
'band_id',
'bewerbung_id',
'status', // submitted, in_review, accepted, rejected
'message',
'demo_link',
'privacy_ok',
];
protected $casts = [
'privacy_ok' => 'boolean',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function band()
{
return $this->belongsTo(Band::class);
}
public function bewerbung()
{
return $this->belongsTo(Bewerbung::class);
}
}
+11
View File
@@ -28,4 +28,15 @@ class Bewerbung extends Model
'start_at' => 'datetime',
'end_at' => 'datetime',
];
// app/Models/Bewerbung.php
public function applications()
{
return $this->hasMany(\App\Models\BandApplication::class, 'bewerbung_id');
}
public function getRouteKeyName()
{
return 'slug';
}
}