From 1d2e3b773d6832e017be219e06b625e2f7c064fe Mon Sep 17 00:00:00 2001 From: Matthew Shillam Date: Tue, 23 Oct 2018 19:05:10 +0100 Subject: [PATCH] Add relationships --- app/Client.php | 9 +++++++++ app/Schedule.php | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/app/Client.php b/app/Client.php index 3cb911c..f47bad4 100644 --- a/app/Client.php +++ b/app/Client.php @@ -26,4 +26,13 @@ class Client extends Model */ protected $guarded = [ 'id' ]; + + /** + * + */ + public function schedules() + { + return $this->hasMany(Schedule::class); + } + } \ No newline at end of file diff --git a/app/Schedule.php b/app/Schedule.php index 1404752..327d7ae 100644 --- a/app/Schedule.php +++ b/app/Schedule.php @@ -13,4 +13,13 @@ class Schedule extends Model */ protected $guarded = [ 'id' ]; + + /** + * + * + */ + public function client() + { + return $this->belongsTo(Client::class); + } }