Advertisement
meracle96

asdsadas

May 2nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. $foto = $request->file('foto');
  2. $filename = time().'.'.$foto->getClientOriginalExtension();
  3. Image::make($foto)->resize(400,400)->save( public_path('/uploads/fotobaju/'.$filename));
  4.  
  5. $baju = new Baju;
  6. $baju->nama = $request->nama;
  7. $baju->penjelasan = $request->penjelasan;
  8. $baju->harga = $request->harga;
  9. $baju->foto = $filename;
  10. $baju->save();
  11.  
  12. return redirect()->back();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement