updates for admin area
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AdminNotification extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'body', 'audience', 'status', 'published_at'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['published_at' => 'datetime'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AppSetting extends Model
|
||||
{
|
||||
protected $fillable = ['key', 'label', 'value', 'type', 'group', 'description'];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ContentPage extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'slug', 'excerpt', 'body', 'status', 'published_at'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['published_at' => 'datetime'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LegalDocument extends Model
|
||||
{
|
||||
protected $fillable = ['type', 'title', 'version', 'body', 'status', 'published_at'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['published_at' => 'datetime'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Message extends Model
|
||||
{
|
||||
protected $fillable = ['from_user_id', 'to_user_id', 'subject', 'body', 'status', 'read_at'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['read_at' => 'datetime'];
|
||||
}
|
||||
|
||||
public function fromUser()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'from_user_id');
|
||||
}
|
||||
|
||||
public function toUser()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'to_user_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Payment extends Model
|
||||
{
|
||||
use HasUlids;
|
||||
|
||||
protected $fillable = ['booking_id', 'user_id', 'amount', 'provider', 'reference', 'status', 'paid_at', 'notes'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['amount' => 'decimal:2', 'paid_at' => 'datetime'];
|
||||
}
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SavedReport extends Model
|
||||
{
|
||||
protected $fillable = ['name', 'type', 'description', 'filters', 'is_active'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['filters' => 'array', 'is_active' => 'boolean'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SupportTicket extends Model
|
||||
{
|
||||
use HasUlids;
|
||||
|
||||
protected $fillable = ['user_id', 'subject', 'category', 'priority', 'status', 'description', 'resolution'];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user