Files
shipping-portal/app/Models/PackingListPackage.php
T

47 lines
1.5 KiB
PHP

<?php
namespace App\Models;
use Eloquent;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Query\Builder;
use Spatie\Activitylog\Models\Activity;
/**
* App\Models\PackingListPackage
*
* @property-read Collection|Activity[] $activities
* @property-read int|null $activities_count
* @property-read Model|Eloquent $causer
* @property-read Package|null $package
* @property-read PackingList|null $packageList
* @property-read Model|Eloquent $subject
* @property-read Model|Eloquent $target
* @method static \Illuminate\Database\Eloquent\Builder|PackingListPackage newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PackingListPackage newQuery()
* @method static Builder|PackingListPackage onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|PackingListPackage query()
* @method static Builder|PackingListPackage withTrashed()
* @method static Builder|PackingListPackage withoutTrashed()
* @mixin Eloquent
*/
class PackingListPackage extends AbstractModel
{
use SoftDeletes;
protected $table = 'packing_list_packages';
public function package(): BelongsTo
{
return $this->BelongsTo(Package::class, 'package_id', 'id');
}
public function packageList(): BelongsTo
{
return $this->BelongsTo(PackingList::class, 'packing_list_id', 'id');
}
}