From dcf9f48364fb8cf47cf8b7f944607d353a3caeac Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Mon, 2 Mar 2020 17:38:48 -0500 Subject: [PATCH] Add ID column to fare #608 --- app/Http/Resources/Fare.php | 4 ++++ app/Models/Fare.php | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/Http/Resources/Fare.php b/app/Http/Resources/Fare.php index 77e67d6e..996c3eec 100644 --- a/app/Http/Resources/Fare.php +++ b/app/Http/Resources/Fare.php @@ -4,11 +4,15 @@ namespace App\Http\Resources; use Illuminate\Http\Resources\Json\Resource; +/** + * @mixin \App\Models\Fare + */ class Fare extends Resource { public function toArray($request) { return [ + 'id' => $this->id, 'code' => $this->code, 'name' => $this->name, 'price' => $this->price, diff --git a/app/Models/Fare.php b/app/Models/Fare.php index c4cc8df6..b0ec45b6 100644 --- a/app/Models/Fare.php +++ b/app/Models/Fare.php @@ -5,13 +5,14 @@ namespace App\Models; use App\Contracts\Model; /** - * Class Fare - * - * @property int capacity + * @property string name * @property float cost * @property float price - * @property mixed code - * @property mixed count Only when merged with pivot + * @property int code + * @property int capacity + * @property int count Only when merged with pivot + * @property string notes + * @property bool active */ class Fare extends Model {