app/Http/Controllers/FilmController.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)
    {
        $film = new Film([
            'name' => $request->get('name'),
            'ticket_price' => $request->get('ticket_price'),
            'description' => $request->get('description'),
            'release_date' => $request->get('release_date'),
            'rating' => $request->get('rating'),
            'genre' => $request->get('genre'),
            'country' => $request->get('country'),
            'photo' => $request->get('photo')
        ]);
        $film->save();
        return response()->json('Successfully added');
    }
public function store ( Request $ request ) { $ film = new Film ( [ 'name' => $ request -> get ( 'name' ) , 'ticket_price' => $ request -> get ( 'ticket_price' ) , 'description' => $ request -> get ( 'description' ) , 'release_date' => $ request -> get ( 'release_date' ) , 'rating' => $ request -> get ( 'rating' ) , 'genre' => $ request -> get ( 'genre' ) , 'country' => $ request -> get ( 'country' ) , 'photo' => $ request -> get ( 'photo' ) ] ) ; $ film -> save ( ) ; return response ( ) -> json ( 'Successfully added' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .