create blade file for report

This commit is contained in:
2025-03-02 10:11:13 +03:30
parent cb91f469f8
commit a65ec5e2bd
4 changed files with 246 additions and 36 deletions

View File

@@ -2,9 +2,11 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\SafetyAndPrivacyReportAble;
use Illuminate\Support\Facades\Storage;
class SafetyAndPrivacy extends Model
{
@@ -60,4 +62,23 @@ class SafetyAndPrivacy extends Model
}
}
protected function recognizePicture(): Attribute
{
return Attribute::make(
get: fn($value) => $value == null ? null :
(filter_var($value, FILTER_VALIDATE_URL)
? $value
: Storage::disk('public')->url($value))
);
}
protected function actionPicture(): Attribute
{
return Attribute::make(
get: fn($value) => $value == null ? null :
(filter_var($value, FILTER_VALIDATE_URL)
? $value
: Storage::disk('public')->url($value))
);
}
}