<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Syarikat extends Model
{
    use HasFactory;   
    
    
    protected $fillable = [
        'name',
        'jenis_perniagaan',
        'nossm',
        'alamat',
        'notelefon',
        'bil_cawangan',
        'tarikh_luput'
    ];
    
    public function users()
    {
        return $this->belongsToMany(User::class, 'user_syarikats', 'syarikat_id', 'user_id');
    }
}
