for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Models\Concerns\Customer;
use App\Models\Customer;
use App\Support\Model\Event as ModelEvent;
use Illuminate\Support\Facades\Storage;
/**
* @see \App\Models\Customer
*/
trait Event
{
use ModelEvent;
* Boot the trait on the model.
*
* @return void
protected static function bootEvent()
static::saving(function (Customer $model) {
if (is_null($model->identitycard_image)) {
Storage::delete(Customer::IDENTITYCARD_IMAGE_PATH . '/' . $model->getRawOriginal('identitycard_image'));
$model->getRawOriginal('identitycard_image')
array|mixed
concatenation
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
Storage::delete(Customer::IDENTITYCARD_IMAGE_PATH . '/' . /** @scrutinizer ignore-type */ $model->getRawOriginal('identitycard_image'));
}
});