Added some basic methods to the models to get roperties from related models or
the related models themselfes.
This commit is contained in:
+9
-1
@@ -6,5 +6,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Booking extends Model
|
||||
{
|
||||
//
|
||||
public function amount()
|
||||
{
|
||||
return $this->hasMany('App\SubBooking')->amount;
|
||||
}
|
||||
|
||||
public function signedAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user