isRole('student'); } public function update(User $user, $course) { if (is_string($course)) { $course_ = Course::where('slug', $course)->first(); } else { $course_ = $course; } return $user->id === $course_->user_id || $user->isRole('admin'); } }