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

62 lines
2.1 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 Illuminate\Support\Carbon;
use Spatie\Activitylog\Models\Activity;
/**
* Class State
*
* @package App\Models
* @property Country country_id
* @property string name
* @property int $id
* @property int $status
* @property Carbon|null $deleted_at
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property-read Collection|Activity[] $activities
* @property-read int|null $activities_count
* @property-read Model|Eloquent $causer
* @property-read Country|null $country
* @property-read Model|Eloquent $subject
* @property-read Model|Eloquent $target
* @method static \Illuminate\Database\Eloquent\Builder|State newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|State newQuery()
* @method static Builder|State onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|State query()
* @method static \Illuminate\Database\Eloquent\Builder|State whereCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|State whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|State whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|State whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|State whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|State whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|State whereUpdatedAt($value)
* @method static Builder|State withTrashed()
* @method static Builder|State withoutTrashed()
* @mixin Eloquent
*/
class State extends AbstractModel
{
use SoftDeletes;
protected $table = 'states';
protected $dates = ['deleted_at'];
/**
* @return BelongsTo
*/
public function country(): BelongsTo
{
return $this->belongsTo(Country::class, 'country_id', 'id');
}
}