Added a method to get all (sub-)bookings associated with a person-target.
19 lines
331 B
PHP
19 lines
331 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class PersonTarget extends Model
|
|
{
|
|
/*
|
|
* Get all bookings associated with a target.
|
|
*
|
|
* @return Illuminate\Database\Eloquent\Collection
|
|
*/
|
|
public function getBookings()
|
|
{
|
|
return $this->hasMany('\App\SubBooking')->get();
|
|
}
|
|
}
|