app/Http/Controllers/CourseController.php
/**
     * Store a newly created course in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created course in storage.
Store a newly created course in storage .
public function store(CourseRequest $request)
    {
        $data = $request->all();
        $data['ts_expire'] = strtotime($data['ts_expire']);
        $data['ts_register'] = Carbon::now()->timestamp;
        $data['user_id'] = Auth::user()->id;
        Course::create($data);
        return redirect()->route('course.index')->with('store', 'New course created');
    }
public function store ( CourseRequest $ request ) { $ data = $ request -> all ( ) ; $ data [ 'ts_expire' ] = strtotime ( $ data [ 'ts_expire' ] ) ; $ data [ 'ts_register' ] = Carbon :: now ( ) -> timestamp ; $ data [ 'user_id' ] = Auth :: user ( ) -> id ; Course :: create ( $ data ) ; return redirect ( ) -> route ( 'course.index' ) -> with ( 'store' , 'New course created' ) ; }
Store a newly created course in storage.
Store a newly created course in storage .