/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $rental = Rental::findOrFail($id);
     $rental->delete();
     Session::flash('success', 'Rental deleted');
     return redirect()->back();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 25) as $index) {
         Rental::create(['renter_id' => $faker->randomDigitNotNull, 'landlord_id' => $faker->randomDigitNotNull, 'rating' => $faker->numberBetween($min = 1, $max = 5), 'name' => $faker->company, 'address' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->stateAbbr, 'zipcode' => $faker->postcode, 'image' => $faker->imageUrl($width = 250, $height = 250), 'beds' => $faker->numberBetween($min = 0, $max = 10), 'baths' => $faker->numberBetween($min = 1, $max = 10), 'square_feet' => $faker->numberBetween($min = 200, $max = 10000)]);
     }
 }
 /**
  * @param  integer
  * @return mixed
  */
 public function show($id)
 {
     $rental = Rental::find($id);
     if (!$rental) {
         return $this->respondNotFound('Rental listing not found.');
     }
     return $this->respond(['data' => $rental]);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Rental::truncate();
     $this->call('RentalsSeeder');
 }
 public function getAdminRentals(Rental $rentals)
 {
     return view('admin.management-pannels.rentals')->with('rentals', $rentals->getRented())->with('dvds', $this->dvds->retrieveAllDvds());
 }