SHARE
TWEET

Untitled

a guest Jan 20th, 2020 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Model;
  4.  
  5. use Illuminate\Database\Eloquent\Model;
  6. use Illuminate\Database\Eloquent\SoftDeletes;
  7.  
  8. class Outlet extends Model
  9. {
  10.     use SoftDeletes;
  11.     protected $table = 'outlets';
  12.     protected $connection = 'mysql';
  13.     protected $primaryKey = 'id';
  14.  
  15.     public $timestamps = true;
  16.     public $incrementing = true;
  17.  
  18.     public function companies()
  19.     {
  20.         return $this->belongsToMany(Company::class, 'company_outlet', 'outlet_id', 'company_id')
  21.         ->withPivot([
  22.             'outlet_code','client_code'
  23.         ])
  24.         ->withTimestamps();
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top