app/Http/Controllers/CalendarController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $events = Event::select('title', 'start_at AS start', 'end_at AS end')->get();
        $validated = $request->validate([
            'title' => 'required', 
            'start_at' => 'required', 
            'end_at' => 'required',
        ]);
        $todo = Calendar::create([ 
            'title' => $request->title, 
            'start_at' => $request->date('start_at'),
            'end_at' => $request->date('end_at'), 
       ]);
        return view('calendar');
    }
public function store ( Request $ request ) { $ validated = $ request -> validate ( [ 'title' => 'required' , 'start_at' => 'required' , 'end_at' => 'required' , ] ) ; $ todo = Calendar :: create ( [ 'title' => $ request -> title , 'start_at' => $ request -> date ( 'start_at' ) , 'end_at' => $ request -> date ( 'end_at' ) , ] ) ; return view ( 'calendar' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// //$events = Event::select('title', 'start_at AS start', 'end_at AS end')->get();