Server : Apache System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64 User : tradze ( 1001) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/tradze/public_html/app/Modules/Corporate/Models/ |
<?php
namespace App\Modules\Corporate\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Storage;
class CorporateEvent extends Model
{
use SoftDeletes;
/**
* The database table used by the model.
*
* @var string
*/
protected $table="corporate_events";
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'user_id',
'title',
'client_id',
'account_id',
'duration',
'event_date',
'event_hour',
'addr_postcode',
'addr_city',
'addr_state',
'addr_address',
'amount_value',
'commision_value'
];
/**
* The attributes dates
*
* @var array
*/
protected $dates = ['created_at', 'updated_at', 'deleted_at','event_date'];
/**
* The Company Client that belong to the event.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function client()
{
return $this->belongsTo('App\Modules\Corporate\Models\Client','client_id');
}
/**
* The Account that belong to the event.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function account()
{
return $this->belongsTo('App\Modules\Accounts\Models\Account','account_id');
}
/**
* The therapists that belong to the event.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function therapists()
{
return $this->belongsToMany('App\User','corporate_events_therapists','event_id','therapist_id')->withTimestamps()->withPivot('id','commision_value');
}
/**
* The event invoice
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function invoice()
{
return $this->morphMany('App\Modules\Invoices\Models\Invoice','invoiceable');
}
}