Updated logo API

This commit is contained in:
2026-04-25 22:57:18 +10:00
parent 678096b463
commit de183995b6
26 changed files with 1088 additions and 64 deletions
+31 -4
View File
@@ -2,19 +2,46 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserAction extends Model
{
protected $fillable = [
'user_id',
'user_flight_id',
'message',
'type',
'data'
];
protected $casts = [
'user_flight_id' => 'integer',
'user_id' => 'integer',
'message' => 'string',
'data' => 'array',
];
protected $appends = [
'display_type',
];
protected function displayType(): Attribute
{
return Attribute::make(
get: fn () => match ($this->type) {
'flight_booked' => 'Flight Booked',
'flight_cancelled' => 'Flight Cancelled',
'flight_updated' => 'Flight Updated',
'flight_imported' => 'Flight Imported',
'flight_logged' => 'Flight Logged',
'flight_deleted' => 'Flight Deleted',
default => 'Unknown Action'
}
);
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
}