2022-01-11 12:39:28 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
2024-02-15 15:53:36 +01:00
|
|
|
use App\Traits\Models\ActivityLog;
|
2022-01-11 12:39:28 +01:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2023-12-12 14:56:12 +01:00
|
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
2022-01-11 12:39:28 +01:00
|
|
|
|
2023-08-24 13:00:43 +02:00
|
|
|
/**
|
2023-12-12 14:56:12 +01:00
|
|
|
* Bon de réduction crée à partir de MesBr lors d'un gain
|
2023-08-24 13:00:43 +02:00
|
|
|
*
|
2023-12-12 14:56:12 +01:00
|
|
|
* @property string $link Lien généré par le client MesBr pour accéder au Coupon.
|
|
|
|
|
* @property string $basket_id Identifiant du panier MesBr (spécifique au client).
|
|
|
|
|
* @property string $verification Lien généré par le client MesBr pour ??
|
2023-08-24 13:00:43 +02:00
|
|
|
* @property-read \Illuminate\Support\Carbon $created_at Creation Date.
|
|
|
|
|
* @property-read \Illuminate\Support\Carbon $updated_at Last update Date.
|
|
|
|
|
*
|
|
|
|
|
* @property-read \App\Models\Participation $participation Associated participation.
|
2024-02-15 15:53:36 +01:00
|
|
|
*
|
|
|
|
|
* @property-read \App\Models\ActivityLog $activityLogs Activities logs One-to-many relationship.
|
2023-08-24 13:00:43 +02:00
|
|
|
*/
|
2023-12-08 15:39:13 +01:00
|
|
|
class Discount extends Model
|
2022-01-11 12:39:28 +01:00
|
|
|
{
|
2024-02-15 15:53:36 +01:00
|
|
|
use ActivityLog;
|
|
|
|
|
|
2023-12-07 15:15:08 +01:00
|
|
|
// * RELATIONSHIPS
|
|
|
|
|
|
2022-01-11 12:39:28 +01:00
|
|
|
/**
|
|
|
|
|
* One to one Participation relation
|
|
|
|
|
*
|
2023-12-12 14:56:12 +01:00
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
2022-01-11 12:39:28 +01:00
|
|
|
*/
|
2023-12-12 14:56:12 +01:00
|
|
|
public function participation(): HasOne
|
2022-01-11 12:39:28 +01:00
|
|
|
{
|
2023-12-12 14:56:12 +01:00
|
|
|
return $this->hasOne(Participation::class);
|
2022-01-11 12:39:28 +01:00
|
|
|
}
|
2024-02-15 15:53:36 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Activities logs One-to-many relationship.
|
|
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
|
*/
|
|
|
|
|
public function activityLogs(): \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(ActivityLog::class);
|
|
|
|
|
}
|
2022-01-11 12:39:28 +01:00
|
|
|
}
|