HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/helder.komma.pro/app/Komma/Address/Models/Address.php
<?php


namespace App\Komma\Address\Models;


use App\Komma\Company\Models\Company;
use App\Komma\Users\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

/**
 * Class Address
 *
 * @package App\Komma\Users\Models
 * @property int $id
 * @property string $street
 * @property string $house_number
 * @property string $postal_code
 * @property string $city
 * @property string $telephone
 * @property string $country
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Company\Models\Company[] $company
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Komma\Users\Models\User[] $users
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address whereCity($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address whereCountry($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address whereHouseNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address wherePostalCode($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address whereStreet($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address whereTelephone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Komma\Address\Models\Address whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Address extends Model
{
    /**
     * The attributes that should be mutated to dates.
     *
     * @var array
     */

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'street',
        'house_number',
        'postal_code',
        'city',
        'telephone',
        'country',
    ];

    /**
     * Returns the users this address belongs to
     *
     * @return BelongsToMany
     */
    public function users(): BelongsToMany
    {
        return $this->belongsToMany(User::class);
    }

    /**
     * Returns the companies this address belongs to
     *
     * @return BelongsToMany
     */
    public function company(): BelongsToMany
    {
        return $this->belongsToMany(Company::class);
    }
}