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 Company extends Model
- {
- use SoftDeletes;
- protected $table = 'companies';
- protected $connection = 'mysql';
- protected $primaryKey = 'id';
- protected $fillable = [ 'name', 'postal_code', 'address', 'logo' ];
- public $timestamps = true;
- public $incrementing = true;
- public function outlets()
- {
- return $this->belongsToMany(Outlet::class, 'company_outlet', 'company_id', 'outlet_id')
- ->withPivot([
- 'outlet_code','client_code'
- ])
- ->withTimestamps();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement