Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

67
app/Models/Meeting.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
namespace App\Models;
use App\Models\Locations\Location;
use App\Models\Post;
use App\Traits\LocationTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Meeting extends Model
{
use HasFactory, SoftDeletes;
use LocationTrait;
protected $fillable = ['post_id', 'venue', 'address', 'price', 'based_on_quantity', 'transaction_type_id', 'meetingable_id', 'meetingable_type', 'status', 'from', 'till'];
/**
* Get related post for this event
* Ont-to-one relationship
* @return void
*/
public function post()
{
return $this->belongsTo(Post::class);
}
/**
* Get the organizer of the meeting (i.e. user or organization).
*
* @return void
*/
public function meetingable()
{
return $this->morphTo();
}
/**
* Get the organizer of the meeting (i.e. user or organization).
* Accessor and alias of meetingable.
*
* @return void
*/
public function getOrganizerAttribute()
{
return $this->meetingable;
}
public function location()
{
return $this->morphOne(Location::class, 'locatable');
}
/**
* Get the transaction type for this meeting
*/
public function transactionType()
{
return $this->belongsTo(\App\Models\TransactionType::class, 'transaction_type_id');
}
}