Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Model;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class Outlet extends Model
- {
- use SoftDeletes;
- protected $table = 'outlets';
- protected $connection = 'mysql';
- protected $primaryKey = 'id';
- public $timestamps = true;
- public $incrementing = true;
- public function companies()
- {
- return $this->belongsToMany(Company::class, 'company_outlet', 'outlet_id', 'company_id')
- ->withPivot([
- 'outlet_code','client_code'
- ])
- ->withTimestamps();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement