app/Http/Controllers/LaptopController.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)
    {
        laptop::create([
            'name'=>$request->name,
            'price'=>$request->price,
            'image'=>$request->file('image')->store('laptop-image')
        ]);
        return redirect()->route('laptop.index') ->with('success', 'Data berhasil ditambahkan');
    }
public function store ( Request $ request ) { laptop :: create ( [ 'name' => $ request -> name , 'price' => $ request -> price , 'image' => $ request -> file ( 'image' ) -> store ( 'laptop-image' ) ] ) ; return redirect ( ) -> route ( 'laptop.index' ) -> with ( 'success' , 'Data berhasil ditambahkan' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .