Ejemplo n.º 1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $calendarId
  * @param  int $timeslotId
  * @return \Illuminate\Http\Response
  */
 public function destroy($calendarId, $timeslotId)
 {
     //
     $calendar = Calendar::findOrFail($calendarId);
     $this->authorize($calendar);
     $timeslot = Timeslot::findOrFail($timeslotId);
     $this->authorize($timeslot);
     $timeslot->delete();
     return $timeslot;
 }
Ejemplo n.º 2
0
 public function testShowNotMine()
 {
     $employee = \plunner\Employee::findOrFail(1);
     $calendar = $employee->Calendars()->firstOrFail();
     $timeslot = \plunner\Timeslot::whereNotIn('calendar_id', $employee->calendars()->get()->pluck('id'))->firstOrFail();
     $response = $this->actingAs($employee)->json('GET', '/employees/calendars/' . $calendar->id . '/timeslots/' . $timeslot->id);
     $response->seeStatusCode(403);
 }