is_public && $this->is_accepted){ return true; } if(!$this->is_public && $this->owner_id == \Auth::user()->id){ return true; } } public function company() { return $this->belongsTo(Company::class); } }