Total Complexity | 5 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class ExportStoredFile extends Model |
||
15 | { |
||
16 | use HasFactory; |
||
17 | |||
18 | protected $guarded = []; |
||
19 | |||
20 | public $withoutActionEvents = true; |
||
21 | |||
22 | protected $casts = [ |
||
23 | 'meta' => SimpleJsonField::class, |
||
24 | ]; |
||
25 | |||
26 | public function getTable(): string |
||
29 | } |
||
30 | |||
31 | protected static function newFactory() |
||
34 | } |
||
35 | |||
36 | protected static function boot() |
||
37 | { |
||
38 | parent::boot(); |
||
39 | |||
40 | self::deleting(function (self $model) { |
||
41 | $storage = Storage::disk($model->disk); |
||
42 | if ($storage->exists($model->path)) { |
||
43 | $storage->delete($model->path); |
||
44 | } |
||
45 | }); |
||
46 | } |
||
47 | |||
48 | public function downloadLink(): Attribute |
||
51 | } |
||
52 | } |
||
53 |