Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/job-board.corals.io/Corals/modules/Reservation/Models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/job-board.corals.io/Corals/modules/Reservation/Models/Reservation.php
<?php

namespace Corals\Modules\Reservation\Models;

use Corals\Foundation\Models\BaseModel;
use Corals\Foundation\Traits\ModelUniqueCode;
use Corals\Foundation\Transformers\PresentableTrait;
use Corals\Modules\Payment\Common\Models\Invoice;
use Spatie\Activitylog\Traits\LogsActivity;

class Reservation extends BaseModel
{
    use PresentableTrait, LogsActivity, ModelUniqueCode;

    /**
     *  Model configuration.
     * @var string
     */
    public $config = 'reservation.models.reservation';

    protected $casts = [
        'properties' => 'json',
        'starts_at' => 'datetime',
        'ends_at' => 'datetime'
    ];

    protected $guarded = ['id'];

    protected $table = 'res_reservations';

    public function owner()
    {
        return $this->morphTo();
    }

    public function object()
    {
        return $this->morphTo();
    }

    public function service()
    {
        return $this->belongsTo(Service::class);
    }

    public function lineItemValues()
    {
        return $this->morphMany(LineItemValue::class, 'parent');
    }

    public function invoice()
    {
        return $this->morphOne(Invoice::class, 'invoicable');
    }

    public function getInvoiceReference()
    {
        return sprintf("Reservation: %s", $this->code);
    }

    public function getTransactionSource()
    {
        $reservation_code = $this->code;
        return "<a target='_blank' href='" . url('reservation/reservations/' . $this->hashed_id) . "'>  $reservation_code </a>";

    }

}

Spamworldpro Mini