create blade file for report
This commit is contained in:
@@ -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))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user