Guest User

Untitled

a guest
Feb 24th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public function store(Request $request, $id){
  2. $Advert = new PropertyAdvert();
  3.  
  4. $Advert::create(
  5. [
  6. "photo" => base64_encode(file_get_contents($request->photo->path())),
  7. "address" => $request->address,
  8. "county" => $request->county,
  9. "town" => $request->town,
  10. "type" => $request->type,
  11. "rent" => $request->rent,
  12. "date" => $request->date,
  13. "bedrooms" => $request->bedrooms,
  14. "bathrooms" => $request->bathrooms,
  15. "furnished" => $request->furnished,
  16. "description" => $request->description
  17. ]
  18. );
  19.  
  20. return redirect('/property/id');
  21. }
  22.  
  23. public function show($id){
  24. $user = Auth::user();
  25. $Advert = PropertyAdvert::where('id', $id)->first();
  26. return view('pages/Advert/show', compact('Advert', 'user'));
  27. }
  28.  
  29. Route::get('/property/{id}', 'AdvertisementController@show');
Add Comment
Please, Sign In to add comment