public function getViewProperty($id)
 {
     $prop = Properties::find($id);
     // used history function declared in Properties model
     // built in functions for Eloquent Model Relationships
     $histories = PropertiesHistory::where('properties_id', $id)->orderBy('created_at', 'DESC')->get();
     if (!$prop) {
         App::abort(404);
     }
     return View::make('prop.view-property')->with('histories', $histories)->with('prop', $prop);
 }
示例#2
0
 public function getViewUserProperty($id)
 {
     $prop = Properties::find($id);
     $histories = PropertiesHistory::where('properties_id', $id)->orderBy('created_at', 'desc')->get();
     if (!$prop) {
         App::abort(404);
     }
     return View::make('view-property')->with('histories', $histories)->with('prop', $prop);
 }