From 181621dcf58781663c9de7122449fed8df7a3f4b Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Fri, 24 Nov 2023 15:49:44 +0100 Subject: [PATCH] Add basket model docblock --- app/Models/Basket.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/Models/Basket.php b/app/Models/Basket.php index 86b7c7a..532e376 100644 --- a/app/Models/Basket.php +++ b/app/Models/Basket.php @@ -4,9 +4,23 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Str; +/** + * Basket + * + * @property integer $id Basket Id. + * @property string $reference Basket Reference. + * @property integer $customer_id Basket Cutomer Id. + * @property-read \Carbon\Carbon $created_at Created date. + * @property-read \Carbon\Carbon $updated_at Updated date. + * + * * RELATIONS + * @property-read \App\Models\Customer $customer The content owned by the Basket + * @property-read \App\Models\BasketsContent $content The customer that owns the Basket + */ class Basket extends Model { use HasFactory; @@ -32,6 +46,16 @@ class Basket extends Model return $this->hasMany(BasketsContent::class); } + /** + * Get the customer that owns the Basket + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function customer(): BelongsTo + { + return $this->belongsTo(Customer::class); + } + /** * The "booted" method of the model. *