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