app/Http/Controllers/PartnerController.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,$about_id)
    {
        $data=request()->validate([
           'partners_image'=>'mimes:jpeg,jpg,png,gif|required|max:10000',
        ]);
        $imagePath = request('partners_image')->store('PartnersImages', 'public');
        $image = Image::make("storage/{$imagePath}")->fit(150, 150);
        $partner=Partner::create([
           'partners_image'=>$imagePath,
            'about_id'=>$about_id,
        ]);
        return redirect('/partner');
    }
public function store ( Request $ request , $ about_id ) { $ data = request ( ) -> validate ( [ 'partners_image' => 'mimes:jpeg,jpg,png,gif|required|max:10000' , ] ) ; $ imagePath = request ( 'partners_image' ) -> store ( 'PartnersImages' , 'public' ) ; $ image = Image :: make ( " storage/ { $ imagePath } " ) -> fit ( 150 , 150 ) ; $ partner = Partner :: create ( [ 'partners_image' => $ imagePath , 'about_id' => $ about_id , ] ) ; return redirect ( '/partner' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .