public function location(Request $request)
    {
        $lesson = new Lesson();

        $lesson->location_id = $request->input('location');
        $lesson->state = 'step1';
        $lesson->save();

        try {
            $lesson->step1step2();
        } catch (IllegalStateTransitionException $e) {
            return ['status' => 'Error saving user IllegalStateTransitionException!'];
        }

        return ['status' => 'User saved!'];
    }
public function location(Request $request)
    {
        $lesson = new Lesson();

        $lesson->location_id = $request->input('location');
        $lesson->state = 'step1';
        $lesson->save();

        try {
            $lesson->step1step2();
        } catch (IllegalStateTransitionException $e) {
            return ['status' => 'Error saving user IllegalStateTransitionException!'];
        }

        return ['status' => 'User saved!'];
    }
public function location ( Request $ request ) { $ lesson = new Lesson ( ) ; $ lesson -> location_id = $ request -> input ( 'location' ) ; $ lesson -> state = 'step1' ; $ lesson -> save ( ) ; try { $ lesson -> step1step2 ( ) ; } catch ( IllegalStateTransitionException $ e ) { return [ 'status' => 'Error saving user IllegalStateTransitionException!' ] ; } return [ 'status' => 'User saved!' ] ; }
Save lesson location

@param Request $request
@return array
Save lesson location