UserManageActivity.php 962 Bytes
<?php

namespace App\Models\Views;

use App\Models\Activity;
use App\Models\Project;
use App\Models\User;
use App\Support\Model;
use Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo;

class UserManageActivity extends Model
{
    protected $table = 'user_manage_activities';

    protected $casts = [
        'permission' => 'array'
    ];

    /**
     * @return \Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class)->withTrashed();
    }

    /**
     * @return \Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo
     */
    public function project(): BelongsTo
    {
        return $this->belongsTo(Project::class)->withTrashed();
    }

    /**
     * @return \Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo
     */
    public function activity(): BelongsTo
    {
        return $this->belongsTo(Activity::class)->withTrashed();
    }
}