ldc-legaulois/app/Models/SellItem.php
Jérémy Munsch 9b4af94e73
Closes #39 Send Orders as Email to arcadia and keep generated files
-  clean files after one month
- Dispatch emails as database jobs (retry on fail)
- add command to trigger cleanup of old xml files
2023-09-18 18:17:00 +02:00

47 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
*
* @property integer $id
* @property string $name
* @property float $price
* @property string $picture
* @property string $picture_r
* @property integer $archadia_id
* @property integer $archadia_weight
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
*
* @package App\Models
*/
class SellItem extends Model
{
/**
* Getter html_name
*
* @param mixed $value
* @return string
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
*/
public function getHtmlNameAttribute($value): string
{
// phpcs:enable
return nl2br(strip_tags($this->name));
}
/**
* Convert the model instance to an array.
*
* @return array<string,string|integer|float|array<string,integer>>
*/
public function toArray()
{
return array_merge(parent::toArray(), [
'htmlName' => $this->htmlName
]);
}
}