app/Http/Controllers/CourseLessonController.php
/**
     * Show the form for creating a new lesson.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new lesson.
@return \Illuminate\Http\Response
Show the form for creating a new lesson . @return \ Illuminate \ Http \ Response
public function create($courseID)
    {
        if (!is_numeric($courseID)) {
            return redirect()->route('course.index')->with('invalid-resource', 'Invalid Resource');
        }
        $course = Course::find($courseID);
        if (!$course->is_active || $course->is_finished) {
            return redirect()->route('course.index')->with('invalid-resource', 'You can not add new lesson to deactivated or finished course');
        }
        session()->put('courseID', $courseID);
        return view('panel.lessons.create');
    }
public function create ( $ courseID ) { if ( ! is_numeric ( $ courseID ) ) { return redirect ( ) -> route ( 'course.index' ) -> with ( 'invalid-resource' , 'Invalid Resource' ) ; } $ course = Course :: find ( $ courseID ) ; if ( ! $ course -> is_active || $ course -> is_finished ) { return redirect ( ) -> route ( 'course.index' ) -> with ( 'invalid-resource' , 'You can not add new lesson to deactivated or finished course' ) ; } session ( ) -> put ( 'courseID' , $ courseID ) ; return view ( 'panel.lessons.create' ) ; }
Show the form for creating a new lesson.
Show the form for creating a new lesson .