app/Http/Controllers/Dashboard/AddstoreController.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($request->hasFile('logo')){
            $filenameWithExtention=$request->file('logo')
            ->getClientOriginalName();
            $fileName=pathinfo($filenameWithExtention,
            PATHINFO_FILENAME) ;
            $max_file_uploads=500;
            $extension=$request->file('logo')->getClientOriginalExtension();
            $fileNameStore=$fileName .'_'.time().'.'.$extension;
            $request->file('logo')->move(public_path('uploads/images/images'),$fileNameStore);
        }else{
            $fileNameStore="noImage.jpg";
        }
           $request_data['tsnef']=$request->tsnef;
           $request_data['store_name']=$request->store_name;
           $request_data['store_mobile']=$request->store_mobile;
           $request_data['store_address']=$request->store_address;
           $request_data['logo']=$fileNameStore;
           $request_data['Governorate']=$request->Governorate;
           $request_data['City']=$request->City;
           $request_data['long_map']=$request->lang_map;
           $request_data['lat_map']=$request->lat_map;
           $Employee=AddStore::create($request_data);
           notify_msg('error','تم الاضافه');
           return redirect('admin/addstore');
    }
public function store ( Request $ request ) { if ( $ request -> hasFile ( 'logo' ) ) { $ filenameWithExtention = $ request -> file ( 'logo' ) -> getClientOriginalName ( ) ; $ fileName = pathinfo ( $ filenameWithExtention , PATHINFO_FILENAME ) ; $ max_file_uploads = 500 ; $ extension = $ request -> file ( 'logo' ) -> getClientOriginalExtension ( ) ; $ fileNameStore = $ fileName . '_' . time ( ) . '.' . $ extension ; $ request -> file ( 'logo' ) -> move ( public_path ( 'uploads/images/images' ) , $ fileNameStore ) ; } else { $ fileNameStore = " noImage.jpg " ; } $ request_data [ 'tsnef' ] = $ request -> tsnef ; $ request_data [ 'store_name' ] = $ request -> store_name ; $ request_data [ 'store_mobile' ] = $ request -> store_mobile ; $ request_data [ 'store_address' ] = $ request -> store_address ; $ request_data [ 'logo' ] = $ fileNameStore ; $ request_data [ 'Governorate' ] = $ request -> Governorate ; $ request_data [ 'City' ] = $ request -> City ; $ request_data [ 'long_map' ] = $ request -> lang_map ; $ request_data [ 'lat_map' ] = $ request -> lat_map ; $ Employee = AddStore :: create ( $ request_data ) ; notify_msg ( 'error' , 'تم الاضافه'); return redirect ( 'admin/addstore' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//  $path=$request->file('post_image')->storeAs('public/uploads/images',$fileNameStore);