app/Http/Controllers/OurServiceController.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)
    {
        $this->validate($request, [
            'title' => 'required|max:200',
            'image' => 'required',
            'contentInfo' => 'required',
            'description' => "required"
        ]);
        $ourService = new OurService();
        $ourService->title = $request->title;
        $ourService->image = $request->image;
        $ourService->description = Purifier::clean($request->description);
        $ourService->content = $request->contentInfo;
        $ourService->save();
        return redirect()->route('our_service.index');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'title' => 'required|max:200' , 'image' => 'required' , 'contentInfo' => 'required' , 'description' => " required " ] ) ; $ ourService = new OurService ( ) ; $ ourService -> title = $ request -> title ; $ ourService -> image = $ request -> image ; $ ourService -> description = Purifier :: clean ( $ request -> description ) ; $ ourService -> content = $ request -> contentInfo ; $ ourService -> save ( ) ; return redirect ( ) -> route ( 'our_service.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .