Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $foto = $request->file('foto');
- $filename = time().'.'.$foto->getClientOriginalExtension();
- Image::make($foto)->resize(400,400)->save( public_path('/uploads/fotobaju/'.$filename));
- $baju = new Baju;
- $baju->nama = $request->nama;
- $baju->penjelasan = $request->penjelasan;
- $baju->harga = $request->harga;
- $baju->foto = $filename;
- $baju->save();
- return redirect()->back();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement