app/Http/Controllers/Backend/BlogController.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)
    {
        if((is_null($request->image)&& is_null($request->video))||(!empty($request->image)&&!empty($request->video)))
        {
            return back()->with('error','Please insert atleast 1 file!');
        }
        else
        {
        $all =($request->all());
        $all['image'] = (new SimpleUpload)
            ->file($request->image)
            ->dirName('Blog.Success')
            ->save();
        SuccessStory::create($all);
        return redirect()->route('backend.blog.index')->with('message', 'Story Added Successfully!');
        }       
    }
public function store ( Request $ request ) { if ( ( is_null ( $ request -> image ) && is_null ( $ request -> video ) ) || ( ! empty ( $ request -> image ) && ! empty ( $ request -> video ) ) ) { return back ( ) -> with ( 'error' , 'Please insert atleast 1 file!' ) ; } else { $ all = ( $ request -> all ( ) ) ; $ all [ 'image' ] = ( new SimpleUpload ) -> file ( $ request -> image ) -> dirName ( 'Blog.Success' ) -> save ( ) ; SuccessStory :: create ( $ all ) ; return redirect ( ) -> route ( 'backend.blog.index' ) -> with ( 'message' , 'Story Added Successfully!' ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .