Пример #1
0
 /**
  * @test
  */
 public function canDeleteAddress()
 {
     $address = $this->guardian()->addresses()->orderBy('created_at', 'DESC')->first();
     // Because of the dropdown menu's functionality for delete being
     // in javascript we'll have to simulate the request
     $address->delete();
     // bypassing caching, see above comments
     $this->assertEquals(0, Address::where('id', $address->id)->count());
 }
Пример #2
0
 /**
  * Determine if the user is authorized to make this request.
  *
  * @return bool
  */
 public function authorize()
 {
     return Address::where('id', $this->route('address'))->where('user_id', Auth::id())->exists();
 }