app/Http/Controllers/NavigationController.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)
    {
        $data=request()->validate([
          'logo'=>'required'
        ]);
        $id=auth()->user()->id;
        $imagePath = request('logo')->store('NavigationLogo', 'public');
        $image = Image::make("storage/{$imagePath}")->fit(100, 100);
        $navigation=Navigation::create([
            'logo'=>$imagePath,
            'user_id'=>$id
        ]);
        return redirect('/navigation');
    }
public function store ( Request $ request ) { $ data = request ( ) -> validate ( [ 'logo' => 'required' ] ) ; $ id = auth ( ) -> user ( ) -> id ; $ imagePath = request ( 'logo' ) -> store ( 'NavigationLogo' , 'public' ) ; $ image = Image :: make ( " storage/ { $ imagePath } " ) -> fit ( 100 , 100 ) ; $ navigation = Navigation :: create ( [ 'logo' => $ imagePath , 'user_id' => $ id ] ) ; return redirect ( '/navigation' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .