Compare commits
17 Commits
ea17636670
...
renovate/v
| Author | SHA1 | Date | |
|---|---|---|---|
| 63e7f1a344 | |||
| f0ef2dda8e | |||
|
|
c43bc208b8 | ||
| 968d67d808 | |||
|
|
a1974ce78c | ||
| 2342c6003d | |||
|
|
151c563c4b | ||
| 290d218a0d | |||
|
|
e4223e28be | ||
| c455c76715 | |||
|
|
030013f914 | ||
| a1abe537c3 | |||
|
|
750f8520f5 | ||
| c65265e68e | |||
|
|
3b0eeda209 | ||
| 3da016ae49 | |||
|
|
1bc14aac38 |
@@ -24,8 +24,8 @@ class ItemExporter extends Exporter
|
||||
// Increment and return the row number
|
||||
return ++$rowNumber;
|
||||
}),
|
||||
ExportColumn::make('plant.name')
|
||||
->label('PLANT'),
|
||||
ExportColumn::make('plant.code')
|
||||
->label('PLANT CODE'),
|
||||
ExportColumn::make('category')
|
||||
->label('CATEGORY'),
|
||||
ExportColumn::make('code')
|
||||
|
||||
@@ -8,7 +8,8 @@ use Filament\Actions\Imports\Exceptions\RowImportFailedException;
|
||||
use Filament\Actions\Imports\ImportColumn;
|
||||
use Filament\Actions\Imports\Importer;
|
||||
use Filament\Actions\Imports\Models\Import;
|
||||
use Str;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ItemImporter extends Importer
|
||||
{
|
||||
@@ -48,10 +49,10 @@ class ItemImporter extends Importer
|
||||
->label('Unit of Measure'),
|
||||
ImportColumn::make('plant')
|
||||
->requiredMapping()
|
||||
->exampleHeader('Plant Name')
|
||||
->example('Ransar Industries-I')
|
||||
->label('Plant Name')
|
||||
->relationship(resolveUsing: 'name')
|
||||
->exampleHeader('Plant Code')
|
||||
->example('1000')
|
||||
->label('Plant Code')
|
||||
->relationship(resolveUsing: 'code') // Lookup Plant by code column
|
||||
->rules(['required']),
|
||||
];
|
||||
}
|
||||
@@ -59,36 +60,46 @@ class ItemImporter extends Importer
|
||||
public function resolveRecord(): ?Item
|
||||
{
|
||||
$warnMsg = [];
|
||||
$plantCod = $this->data['plant'];
|
||||
$plant = null;
|
||||
Log::info('ResolveRecord triggered', $this->data);
|
||||
$iCode = trim($this->data['code']);
|
||||
$description = trim($this->data['description']);
|
||||
$plant = Plant::where('name', $this->data['plant'])->first();
|
||||
if (!$plant) {
|
||||
$warnMsg[] = "Plant not found"; // '" . $this->data['plant'] . "'
|
||||
|
||||
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
|
||||
$warnMsg[] = 'Invalid plant code found';
|
||||
} else {
|
||||
$plant = Plant::where('code', $plantCod)->first();
|
||||
if (! $plant) {
|
||||
$warnMsg[] = 'Plant not found'; // '" . $plantCod . "'
|
||||
}
|
||||
}
|
||||
if (Str::length($iCode) < 6 || !ctype_alnum($iCode)) {
|
||||
$warnMsg[] = "Invalid item code found";
|
||||
|
||||
if (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
|
||||
$warnMsg[] = 'Invalid item code found';
|
||||
}
|
||||
// if (Str::length($this->data['uom']) <= 0) {
|
||||
// $warnMsg[] = "Invalid unit of measure found";
|
||||
// }
|
||||
if (Str::length($description) < 5) {
|
||||
$warnMsg[] = "Invalid description found";
|
||||
$warnMsg[] = 'Invalid description found';
|
||||
}
|
||||
if (Str::length($this->data['hourly_quantity']) < 0 || !is_numeric($this->data['hourly_quantity']) || $this->data['hourly_quantity'] <= 0) {
|
||||
$warnMsg[] = "Invalid hourly quantity found";
|
||||
if (Str::length($this->data['hourly_quantity']) < 0 || ! is_numeric($this->data['hourly_quantity']) || $this->data['hourly_quantity'] <= 0) {
|
||||
$warnMsg[] = 'Invalid hourly quantity found';
|
||||
}
|
||||
if (!empty($warnMsg)) {
|
||||
if (! empty($warnMsg)) {
|
||||
throw new RowImportFailedException(implode(', ', $warnMsg));
|
||||
}
|
||||
|
||||
return Item::updateOrCreate([
|
||||
'code' => $iCode,
|
||||
'plant_id' => $plant->id
|
||||
],
|
||||
'code' => $iCode,
|
||||
'plant_id' => $plant->id,
|
||||
],
|
||||
[
|
||||
'category' => trim($this->data['category']),
|
||||
'description' => $description,
|
||||
'hourly_quantity' => $this->data['hourly_quantity'],
|
||||
'uom' => trim($this->data['uom'])
|
||||
'uom' => trim($this->data['uom']),
|
||||
]
|
||||
);
|
||||
// return new Item;
|
||||
|
||||
@@ -976,7 +976,9 @@ class StickerReprint extends Page implements HasForms
|
||||
]);
|
||||
}
|
||||
|
||||
if (!preg_match('/^[a-zA-Z0-9]{6,}+\|[1-9][a-zA-Z0-9]{8,}+(\|)?$/', $formQRData)) {
|
||||
// if (!preg_match('/^[a-zA-Z0-9]{6,}+\|[1-9][a-zA-Z0-9]{8,}+(\|)?$/', $formQRData))
|
||||
// {
|
||||
if (!preg_match('/^[A-Za-z0-9]{6,}\|[1-9][A-Za-z0-9]{7,}(\/[A-Za-z0-9]*)?(\|)?$/', $formQRData)) {
|
||||
if (strpos($formQRData, '|') === false) {
|
||||
$this->form->fill([
|
||||
'plant_id'=> $this->pId,
|
||||
@@ -1004,7 +1006,14 @@ class StickerReprint extends Page implements HasForms
|
||||
{
|
||||
$splits = explode('|', $formQRData);
|
||||
$iCode = trim($splits[0]);
|
||||
$sNumber = isset($splits[1]) ? trim($splits[1]) : null;
|
||||
$sNumberRaw = isset($splits[1]) ? trim($splits[1]) : null;
|
||||
|
||||
if ($sNumberRaw !== null) {
|
||||
$sNumber = preg_replace('/\/.*/', '', $sNumberRaw);
|
||||
$sNumber = trim($sNumber);
|
||||
} else {
|
||||
$sNumber = null;
|
||||
}
|
||||
|
||||
if (!ctype_alnum($iCode)) {
|
||||
$this->form->fill([
|
||||
@@ -1052,6 +1061,7 @@ class StickerReprint extends Page implements HasForms
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
|
||||
else if (!ctype_alnum($sNumber)) {
|
||||
$this->form->fill([
|
||||
'plant_id'=> $this->pId,
|
||||
@@ -1145,9 +1155,18 @@ class StickerReprint extends Page implements HasForms
|
||||
// Only search when all parent IDs are selected
|
||||
$parts = explode('|', $formQRData);
|
||||
$itemCode = trim($parts[0]);
|
||||
$serialNumber = isset($parts[1]) ? trim($parts[1]) : null;
|
||||
$serialNumberRaw = isset($parts[1]) ? trim($parts[1]) : null;
|
||||
|
||||
// Remove slash and everything after it
|
||||
if ($serialNumberRaw != null) {
|
||||
$serialNumber = preg_replace('/\/.*/', '', $serialNumberRaw);
|
||||
$serialNumber = trim($serialNumber);
|
||||
} else {
|
||||
$serialNumber = null;
|
||||
}
|
||||
$item = Item::where('code', $itemCode)->first();
|
||||
|
||||
|
||||
if (!$item) {
|
||||
// Handle unknown item code
|
||||
$this->form->fill([
|
||||
@@ -1364,6 +1383,15 @@ class StickerReprint extends Page implements HasForms
|
||||
$itemCode = trim($parts[0]);
|
||||
$this->sNoId = isset($parts[1]) ? trim($parts[1]) : null;
|
||||
|
||||
if ($this->sNoId != null) {
|
||||
$this->sNoId = preg_replace('/\/.*/', '', $serialNumberRaw);
|
||||
$this->sNoId = trim($this->sNoId);
|
||||
} else {
|
||||
$this->sNoId = null;
|
||||
}
|
||||
|
||||
$this->qrData = preg_replace('/\/.*/', '', $this->qrData);
|
||||
|
||||
ProductionQuantity::create([
|
||||
'plant_id'=> $this->pId,
|
||||
'shift_id'=> $this->sId,
|
||||
@@ -1418,11 +1446,16 @@ class StickerReprint extends Page implements HasForms
|
||||
// Save the form data to the database or perform other operations
|
||||
// For example:
|
||||
$model = ProductionQuantity::create($formValues);
|
||||
// $formValues['serial_number'] = $this->serialNumber;
|
||||
|
||||
// ProductionQuantity::create($formValues);
|
||||
|
||||
// dd('Production Updated Event Dispatched');
|
||||
|
||||
$this->dispatch('productionUpdated');
|
||||
|
||||
|
||||
|
||||
// // Optionally, you can emit an event or perform a redirect after saving
|
||||
// $this->emit('formSaved', $model->id);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Filament\Exports\QualityValidationExporter;
|
||||
use App\Filament\Imports\QualityValidationImporter;
|
||||
use App\Filament\Resources\QualityValidationResource\Pages;
|
||||
use App\Filament\Resources\QualityValidationResource\RelationManagers;
|
||||
// use App\Jobs\SendInvalidQualityMailJob;
|
||||
use App\Mail\InvalidQualityMail;
|
||||
use App\Models\AlertMailRule;
|
||||
use App\Models\Item;
|
||||
@@ -13,6 +14,8 @@ use App\Models\Line;
|
||||
use App\Models\Plant;
|
||||
use App\Models\QualityValidation;
|
||||
use App\Models\StickerMaster;
|
||||
// use App\Models\User;
|
||||
// use App\Notifications\StatusUpdated;
|
||||
use Carbon\Carbon;
|
||||
use Closure;
|
||||
use Filament\Facades\Filament;
|
||||
@@ -45,6 +48,7 @@ class QualityValidationResource extends Resource
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Display';
|
||||
|
||||
public $isSubmitted = false;
|
||||
public $data = [];
|
||||
|
||||
@@ -706,7 +710,6 @@ class QualityValidationResource extends Resource
|
||||
$fileName = "{$value}.png";
|
||||
|
||||
$imageUrl = route('part.validation.image', [
|
||||
'plant' => $plantCode1,
|
||||
'filename' => $fileName
|
||||
]);
|
||||
|
||||
@@ -1731,6 +1734,17 @@ class QualityValidationResource extends Resource
|
||||
|
||||
$set('tube_sticker_motor_error', null);
|
||||
|
||||
// $mPorder = $get('production_order');
|
||||
|
||||
// $mPlantId = $get('plant_id');
|
||||
//$plant = Plant::find($mPlantId);
|
||||
// $plantCodePart4 = $plant?->code;
|
||||
|
||||
// $mlineId = $get('line_id');
|
||||
|
||||
// $mLine = Line::find($mlineId);
|
||||
// $mLinePart = $mLine?->name;
|
||||
|
||||
if (empty($state)) {
|
||||
$set('tube_sticker_motor_error', null);
|
||||
return;
|
||||
@@ -1832,6 +1846,24 @@ class QualityValidationResource extends Resource
|
||||
if (!$isMatch)
|
||||
{
|
||||
$set('tube_sticker_motor_error', 'Serial number does not match.');
|
||||
|
||||
// $mailData = \App\Filament\Resources\QualityValidationResource::getMailData($mPlantId);
|
||||
|
||||
// $mPlantName = $mailData['plant_name'];
|
||||
// $emails = $mailData['emails'];
|
||||
// $mUserName = Filament::auth()->user()->name;
|
||||
|
||||
// if (!empty($emails))
|
||||
// {
|
||||
// //Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
||||
// Mail::to($emails)->send(
|
||||
// new InvalidQualityMail($state, $mPorder, $mPlantName,$mLinePart, $mUserName, 'InvalidTubeStickerMotor')
|
||||
// );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// \Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
||||
// }
|
||||
$set('tube_sticker_motor_qr', null);
|
||||
return;
|
||||
}
|
||||
@@ -1856,10 +1888,32 @@ class QualityValidationResource extends Resource
|
||||
->default('')
|
||||
->required()
|
||||
->reactive()
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state, $livewire) {
|
||||
|
||||
$set('tube_sticker_pump_error', null);
|
||||
|
||||
// $mPorder = $get('production_order');
|
||||
|
||||
// $mPlantId = $get('plant_id');
|
||||
// $plant = Plant::find($mPlantId);
|
||||
// $mPlantName = $plant?->name;
|
||||
|
||||
// $mlineId = $get('line_id');
|
||||
|
||||
// $mLine = Line::find($mlineId);
|
||||
// $mLinePart = $mLine?->name;
|
||||
|
||||
// $mPorder = $get('production_order');
|
||||
// $mPlantId = $get('plant_id');
|
||||
// $mlineId = $get('line_id');
|
||||
// $mUserName = Filament::auth()->user()?->name ?? 'Unknown';
|
||||
|
||||
// $mailData = \App\Filament\Resources\QualityValidationResource::getMailData($mPlantId);
|
||||
|
||||
// $mPlantName = $mailData['plant_name'];
|
||||
// $emails = $mailData['emails'];
|
||||
//$mUserName = Filament::auth()->user()->name;
|
||||
|
||||
if (empty($state)) {
|
||||
$set('tube_sticker_pump_error', null);
|
||||
return;
|
||||
@@ -1941,14 +1995,14 @@ class QualityValidationResource extends Resource
|
||||
// ]);
|
||||
$visibleSerialNumber = $get('serial_number');
|
||||
|
||||
$expectedItemCode = trim((string) $get('item_id'));
|
||||
$expectedItemCode = trim((string) $get('item_id'));
|
||||
|
||||
if ($itemCode != $expectedItemCode) {
|
||||
$set('tube_sticker_pump_error', 'Item code does not match.');
|
||||
return;
|
||||
}
|
||||
if ($itemCode != $expectedItemCode) {
|
||||
$set('tube_sticker_pump_error', 'Item code does not match.');
|
||||
return;
|
||||
}
|
||||
|
||||
$set('tube_sticker_pump_error', $serialNumber);
|
||||
$set('tube_sticker_pump_error', $serialNumber);
|
||||
|
||||
// $isMatch = in_array($serialNumber, $visibleSerialNumbers, true);
|
||||
$isMatch = ($visibleSerialNumber == $serialNumber);
|
||||
@@ -1962,6 +2016,62 @@ class QualityValidationResource extends Resource
|
||||
{
|
||||
$set('tube_sticker_pump_error', 'Serial number does not match.');
|
||||
$set('tube_sticker_pump_qr', null);
|
||||
// $user = User::where('name', $mUserName)->first();
|
||||
|
||||
// if ($user) {
|
||||
// $user->notify(new StatusUpdated($state));
|
||||
// }
|
||||
|
||||
|
||||
// $currentUser = Filament::auth()->user();
|
||||
|
||||
// if ($currentUser) {
|
||||
// $currentUser->notify(new StatusUpdated($state)); // standard Laravel DB notification
|
||||
|
||||
// // refresh Filament bell
|
||||
// $livewire->dispatch('refreshFilamentNotifications');
|
||||
// }
|
||||
|
||||
|
||||
// Notification::make()
|
||||
// ->title('Status Updated')
|
||||
// ->body("Serial number scanned: $state")
|
||||
// ->danger()
|
||||
// ->sendToDatabase($currentUser);
|
||||
|
||||
//$user->notify(new StatusUpdated($state));
|
||||
|
||||
//Notification::send($user, new StatusUpdated($state));
|
||||
|
||||
|
||||
//dd($user);
|
||||
// $user->notify(new StatusUpdated($state));
|
||||
// Inside a Filament page or resource
|
||||
//$this->notify('success', "Serial number scanned: $state");
|
||||
|
||||
// dispatch(new SendInvalidQualityMailJob(
|
||||
// $state, $mPorder, $mPlantId, $mlineId, $mUserName, 'InvalidTubeStickerPump'
|
||||
// ))->afterResponse();
|
||||
|
||||
|
||||
// $mailData = \App\Filament\Resources\QualityValidationResource::getMailData($mPlantId);
|
||||
|
||||
// $mPlantName = $mailData['plant_name'];
|
||||
// $emails = $mailData['emails'];
|
||||
// $mUserName = Filament::auth()->user()->name;
|
||||
|
||||
// if (!empty($emails))
|
||||
// {
|
||||
// //Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
||||
// Mail::to($emails)->queue(
|
||||
// new InvalidQualityMail($state, $mPorder, $mPlantName,$mLinePart, $mUserName, 'InvalidTubeStickerPumpset')
|
||||
// );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// \Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
||||
// }
|
||||
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@@ -1989,6 +2099,17 @@ class QualityValidationResource extends Resource
|
||||
|
||||
$set('tube_sticker_pumpset_error', null);
|
||||
|
||||
$mPorder = $get('production_order');
|
||||
|
||||
$mPlantId = $get('plant_id');
|
||||
//$plant = Plant::find($mPlantId);
|
||||
// $plantCodePart4 = $plant?->code;
|
||||
|
||||
$mlineId = $get('line_id');
|
||||
|
||||
$mLine = Line::find($mlineId);
|
||||
$mLinePart = $mLine?->name;
|
||||
|
||||
if (empty($state)) {
|
||||
$set('tube_sticker_pumpset_error', null);
|
||||
return;
|
||||
@@ -2092,6 +2213,23 @@ class QualityValidationResource extends Resource
|
||||
if (!$isMatch)
|
||||
{
|
||||
$set('tube_sticker_pumpset_error', 'Serial number does not match.');
|
||||
// $mailData = \App\Filament\Resources\QualityValidationResource::getMailData($mPlantId);
|
||||
|
||||
// $mPlantName = $mailData['plant_name'];
|
||||
// $emails = $mailData['emails'];
|
||||
// $mUserName = Filament::auth()->user()->name;
|
||||
|
||||
// if (!empty($emails))
|
||||
// {
|
||||
// //Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
||||
// Mail::to($emails)->send(
|
||||
// new InvalidQualityMail($state, $mPorder, $mPlantName,$mLinePart, $mUserName, 'InvalidTubeStickerPumpset')
|
||||
// );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// \Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
||||
// }
|
||||
$set('tube_sticker_pumpset_qr', null);
|
||||
return;
|
||||
}
|
||||
@@ -2305,7 +2443,7 @@ class QualityValidationResource extends Resource
|
||||
$set('part_validation1', null);
|
||||
|
||||
$fileName = $expectedValue . ".png"; // or .jpg based on your file
|
||||
$fullPath = storage_path("app/private/uploads/PartValidation/{$plantCodePart1}/{$fileName}");
|
||||
$fullPath = storage_path("app/private/uploads/PartValidation/{$fileName}");
|
||||
|
||||
// dd($fullPath);
|
||||
|
||||
@@ -2316,7 +2454,7 @@ class QualityValidationResource extends Resource
|
||||
// ]);
|
||||
if (file_exists($fullPath)) {
|
||||
$imageUrl = route('part.validation.image', [
|
||||
'plant' => $plantCodePart1,
|
||||
// 'plant' => $plantCodePart1,
|
||||
'filename' => $fileName
|
||||
]);
|
||||
} else {
|
||||
@@ -2607,7 +2745,7 @@ class QualityValidationResource extends Resource
|
||||
'filename' => $fileName
|
||||
]);
|
||||
|
||||
$set('part_validation2_error_image', $imageUrl);
|
||||
$set('part_validation4_error_image', $imageUrl);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2771,34 +2909,6 @@ class QualityValidationResource extends Resource
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
// public function getMail(){
|
||||
// //$plantId = $this->form->getState()['plant_id'];
|
||||
// $plantId = $this->data['plant_id'] ?? null;
|
||||
// //$this->plantId = $plantId;
|
||||
// dd($plantId);
|
||||
// $mInvoiceType = 'Serial';
|
||||
// $mPlantName = Plant::where('id', $plantId)->value('name');
|
||||
// $emails = AlertMailRule::where('plant', $plantId)
|
||||
// //->where('plant', $plantName)
|
||||
// ->where('module', 'InvoiceValidation')
|
||||
// ->where('rule_name', 'InvoiceMail')
|
||||
// ->where(function ($query) {
|
||||
// $query->whereNull('schedule_type')
|
||||
// ->orWhere('schedule_type', '');
|
||||
// })
|
||||
// ->pluck('email')
|
||||
// ->toArray();
|
||||
|
||||
// return [
|
||||
// 'plant_id' => $plantId,
|
||||
// 'plant_name' => $mPlantName,
|
||||
// 'invoice_type' => $mInvoiceType,
|
||||
// 'emails' => $emails,
|
||||
// ];
|
||||
// }
|
||||
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
|
||||
@@ -844,50 +844,56 @@ class StickerMasterResource extends Resource
|
||||
|
||||
$plantCode = $plant->code;
|
||||
|
||||
$sticker = StickerMaster::where('plant_id', $plantId)
|
||||
->where('item_id', $itemId)
|
||||
->first();
|
||||
// $sticker = StickerMaster::where('plant_id', $plantId)
|
||||
// ->where('item_id', $itemId)
|
||||
// ->first();
|
||||
|
||||
if (! $sticker) {
|
||||
Notification::make()
|
||||
->title('Unknown Sticker Master')
|
||||
->body('Sticker Master data not found.')
|
||||
->danger()
|
||||
->seconds(2)
|
||||
->send();
|
||||
}
|
||||
// if (! $sticker) {
|
||||
// Notification::make()
|
||||
// ->title('Unknown Sticker Master')
|
||||
// ->body('Sticker Master data not found.')
|
||||
// ->danger()
|
||||
// ->seconds(2)
|
||||
// ->send();
|
||||
// }
|
||||
|
||||
$value = $sticker->{$column};
|
||||
// $value = $sticker->{$column};
|
||||
|
||||
if (empty($value)) {
|
||||
Notification::make()
|
||||
->title('Unknown Part validation')
|
||||
->body("Selected validation '$column' has no value.")
|
||||
->danger()
|
||||
->seconds(2)
|
||||
->send();
|
||||
}
|
||||
// if (empty($value)) {
|
||||
// Notification::make()
|
||||
// ->title('Unknown Part validation')
|
||||
// ->body("Selected validation '$column' has no value.")
|
||||
// ->danger()
|
||||
// ->seconds(2)
|
||||
// ->send();
|
||||
// }
|
||||
|
||||
$newFileName = $value.'.png';
|
||||
// $newFileName = $value.'.png';
|
||||
|
||||
$directory = "uploads/PartValidation/{$plantCode}";
|
||||
$originalName = $uploadedFile->getClientOriginalName();
|
||||
$directory = 'uploads/PartValidation';
|
||||
|
||||
$disk = Storage::disk('local');
|
||||
if (! $disk->exists($directory)) {
|
||||
$disk->makeDirectory($directory, 0755, true);
|
||||
}
|
||||
|
||||
// $fullPath = Storage::disk('local')->path($directory);
|
||||
|
||||
// $directory = "uploads/PartValidation/{$plantCode}";
|
||||
|
||||
// $disk = Storage::disk('local');
|
||||
// if (! $disk->exists($directory)) {
|
||||
// $disk->makeDirectory($directory, 0755, true);
|
||||
// }
|
||||
|
||||
// $path = $uploadedFile->storeAs(
|
||||
// $directory,
|
||||
// $newFileName,
|
||||
// 'local'
|
||||
// );
|
||||
try {
|
||||
$path = $uploadedFile->storeAs(
|
||||
$directory,
|
||||
$newFileName,
|
||||
'local'
|
||||
);
|
||||
$path = $disk->putFileAs($directory, $uploadedFile, $originalName);
|
||||
} catch (\Exception $e) {
|
||||
Notification::make()
|
||||
->title('Upload Failed')
|
||||
|
||||
@@ -20,191 +20,18 @@ class ProductionStickerReprintController extends Controller
|
||||
//
|
||||
}
|
||||
|
||||
// public function downloadQrPdf($palletNo)
|
||||
// {
|
||||
|
||||
// $parts = explode('|', $palletNo);
|
||||
// $itemCode = trim($parts[0]);
|
||||
// $serial = isset($parts[1]) ? trim($parts[1]) : null;
|
||||
|
||||
// // Retrieve the item record by item code
|
||||
// $item = Item::where('code', $itemCode)->first();
|
||||
|
||||
// if (!$item) {
|
||||
// abort(404, "Item with code {$itemCode} not found.");
|
||||
// }
|
||||
|
||||
// $itemId = $item->id;
|
||||
|
||||
// $production = ProductionQuantity::where('item_id', $itemId)
|
||||
// ->where('serial_number', $serial)
|
||||
// ->first();
|
||||
|
||||
// if (!$production) {
|
||||
// abort(404, "Production data for item code '{$itemCode}' with serial '{$serial}' not found.");
|
||||
// }
|
||||
|
||||
// $productionOrder = $production->production_order;
|
||||
|
||||
// $qrCode = new QrCode($palletNo);
|
||||
// $output = new Output\Png();
|
||||
// $qrBinary = $output->output($qrCode, 100);
|
||||
// $qrBase64 = base64_encode($qrBinary);
|
||||
|
||||
// $sticker = StickerMaster::where('item_id', $itemId)->first();
|
||||
|
||||
// // Decide number of copies
|
||||
// $copies = 1;
|
||||
|
||||
// if ($sticker) {
|
||||
// if ($sticker->serial_number_pump == 1) {
|
||||
// // If pump is selected (regardless of motor), 2 copies
|
||||
// $copies = 2;
|
||||
// } elseif ($sticker->serial_number_motor == 1) {
|
||||
// // Only motor selected, 1 copy
|
||||
// $copies = 1;
|
||||
// }
|
||||
// }
|
||||
// return '
|
||||
// <html>
|
||||
// <head>
|
||||
// <style>
|
||||
// body {
|
||||
// margin: 0;
|
||||
// padding: 0;
|
||||
// width: 100mm;
|
||||
// height: 14mm;
|
||||
// font-size: 10pt;
|
||||
// font-family: Arial Narrow, Arial, sans-serif;
|
||||
// }
|
||||
|
||||
// .sticker-table {
|
||||
// width: 100mm;
|
||||
// height: 14mm;
|
||||
// }
|
||||
|
||||
// .text-cell {
|
||||
// margin: 0;
|
||||
// padding: 0;
|
||||
// text-align: left;
|
||||
// font-size: 14pt;
|
||||
// font-weight: normal;
|
||||
// line-height: 1.2;
|
||||
// }
|
||||
|
||||
// .text-row {
|
||||
// font-weight: bold;
|
||||
// font-size: 9pt;
|
||||
// }
|
||||
|
||||
// .serial {
|
||||
// text-align: left;
|
||||
// }
|
||||
|
||||
// .po-number {
|
||||
// text-align: right;
|
||||
// white-space: nowrap;
|
||||
// }
|
||||
|
||||
// .desc-row {
|
||||
// font-weight: normal;
|
||||
// font-size: 8pt;
|
||||
// }
|
||||
|
||||
// .qr-cell {
|
||||
// width: 14mm;
|
||||
// text-align: left;
|
||||
// padding-left: 0mm;
|
||||
// padding-top: 0mm;
|
||||
// }
|
||||
|
||||
// img.qr {
|
||||
// width: 20mm;
|
||||
// height: 20mm;
|
||||
// }
|
||||
// </style>
|
||||
// </head>
|
||||
// <body>
|
||||
// <div id="print-container"></div>
|
||||
// <script>
|
||||
// const copies = ' . $copies . ';
|
||||
// const htmlBlock = `
|
||||
// <table class="sticker-table">
|
||||
// <tr>
|
||||
// <td class="qr-cell">
|
||||
// <img class="qr" src="data:image/png;base64,' . $qrBase64 . '" alt="QR" />
|
||||
// </td>
|
||||
// <td class="text-cell">
|
||||
// <div class="text-row">
|
||||
// <pre><span class="serial">' . htmlspecialchars($serial) . '</span> <span class="po-number">' . htmlspecialchars($productionOrder) . '</span></pre>
|
||||
// </div>
|
||||
// <div class="desc-row">
|
||||
// ' . htmlspecialchars($item->description) . '
|
||||
// </div>
|
||||
// </td>
|
||||
// </tr>
|
||||
// </table>
|
||||
// `;
|
||||
|
||||
// const container = document.getElementById("print-container");
|
||||
// for (let i = 0; i < copies; i++) {
|
||||
// container.insertAdjacentHTML("beforeend", htmlBlock);
|
||||
// }
|
||||
|
||||
// window.onload = function () {
|
||||
// window.print();
|
||||
// setTimeout(function () {
|
||||
// window.close();
|
||||
// }, 500);
|
||||
// };
|
||||
// </script>
|
||||
// </body>
|
||||
// </html>
|
||||
// ';
|
||||
|
||||
|
||||
// //Get sticker master data
|
||||
// // $sticker = StickerMaster::where('item_id', $itemId)->first();
|
||||
|
||||
// // //Decide number of copies
|
||||
// // $copies = 1; // default
|
||||
// // if ($sticker) {
|
||||
// // if ($sticker->serial_number_motor == 1) {
|
||||
// // $copies = 1;
|
||||
// // } elseif (is_null($sticker->serial_number_motor) && $sticker->serial_number_pump == 1) {
|
||||
// // $copies = 2;
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // $mpdf = new Mpdf([
|
||||
// // 'mode' => 'utf-8',
|
||||
// // 'format' => [60, 14],
|
||||
// // 'margin_left' => 0,
|
||||
// // 'margin_right' => 0,
|
||||
// // 'margin_top' => 0,
|
||||
// // 'margin_bottom' => 0,
|
||||
// // ]);
|
||||
|
||||
// // for ($i = 0; $i < $copies; $i++) {
|
||||
// // $mpdf->WriteHTML($html);
|
||||
// // if ($i < $copies - 1) {
|
||||
// // $mpdf->AddPage();
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // $mpdf->Output('qr-label.pdf', 'I');
|
||||
// // exit;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
|
||||
public function downloadQrPdf($palletNo)
|
||||
{
|
||||
$parts = explode('|', $palletNo);
|
||||
$itemCode = trim($parts[0]);
|
||||
$serial = isset($parts[1]) ? trim($parts[1]) : null;
|
||||
$serialNumberRaw = isset($parts[1]) ? trim($parts[1]) : null;
|
||||
|
||||
if ($serialNumberRaw != null) {
|
||||
$serial = preg_replace('/\/.*/', '', $serialNumberRaw);
|
||||
$serial = trim($serial);
|
||||
} else {
|
||||
$serial = null;
|
||||
}
|
||||
|
||||
$item = Item::where('code', $itemCode)->first();
|
||||
$itemId= $item->id;
|
||||
|
||||
@@ -83,7 +83,100 @@ class InvoiceDataTable extends Component
|
||||
// $this->showCapacitorInput = false;
|
||||
}
|
||||
|
||||
public function loadData($invoiceNumber, $plantId, $onCapFocus)
|
||||
// public function loadData($invoiceNumber, $plantId, $onCapFocus)
|
||||
// {
|
||||
// $this->plantId = $plantId;
|
||||
// $this->invoiceNumber = $invoiceNumber;
|
||||
// $this->completedInvoice = false;
|
||||
// $this->isSerial = true;
|
||||
// $this->onCapFocus = $onCapFocus;
|
||||
// $this->emptyInvoice = false;
|
||||
// $this->hasSearched = true;
|
||||
// $this->materialInvoice = false;
|
||||
// // $this->showCapacitorInput = false;
|
||||
|
||||
// // ->where('serial_number', '!=', '')
|
||||
// $this->invoiceData = InvoiceValidation::where('invoice_number', $this->invoiceNumber)
|
||||
// ->where('plant_id', $plantId)->where('scanned_status', null)
|
||||
// ->get()
|
||||
// ->map(function ($record) {
|
||||
// return [
|
||||
// 'sticker_master_id' => $record->sticker_master_id,
|
||||
// 'serial_number' => $record->serial_number,
|
||||
// 'motor_scanned_status' => $record->motor_scanned_status ?? '',
|
||||
// 'pump_scanned_status' => $record->pump_scanned_status ?? '',
|
||||
// 'capacitor_scanned_status' => $record->capacitor_scanned_status ?? '',
|
||||
// 'scanned_status_set' => $record->scanned_status_set ?? '',
|
||||
// 'scanned_status' => $record->scanned_status ?? '',
|
||||
// 'panel_box_supplier' => $record->panel_box_supplier ?? '',
|
||||
// 'panel_box_serial_number' => $record->panel_box_serial_number ?? '',
|
||||
// 'created_at' => $record->created_at,
|
||||
// 'operator_id' => $record->operator_id,
|
||||
// ];
|
||||
// })
|
||||
// ->toArray();
|
||||
|
||||
// $this->packageCount = 0;
|
||||
|
||||
// // Loop through and replace 'code' using related StickerMaster > Item > code
|
||||
// foreach ($this->invoiceData as &$row) {
|
||||
// $stickCount = 0;
|
||||
// $scannedCount = 0;
|
||||
|
||||
// // $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
|
||||
// $row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
|
||||
// $curStick = StickerMaster::where('id', $row['sticker_master_id'])->first();
|
||||
// if ($curStick) {
|
||||
// if (Str::length($curStick->panel_box_code) > 0) {
|
||||
// $stickCount++;
|
||||
// }
|
||||
// if ($curStick->tube_sticker_motor == 1 || $curStick->tube_sticker_pump == 1 || $curStick->tube_sticker_pumpset == 1) {
|
||||
// if ($curStick->tube_sticker_motor == 1) {
|
||||
// $stickCount++;
|
||||
// }
|
||||
// if ($curStick->tube_sticker_pump == 1 || ($curStick->tube_sticker_pumpset != 1 && $curStick->tube_sticker_pump != 1 && $curStick->pack_slip_pump == 1)) {
|
||||
// $stickCount++;
|
||||
// }
|
||||
// if ($curStick->tube_sticker_pumpset == 1) {
|
||||
// $stickCount++;
|
||||
// }
|
||||
// } elseif ($curStick->pack_slip_motor == 1 || $curStick->pack_slip_pump == 1 || $curStick->pack_slip_pumpset == 1) {
|
||||
// if ($curStick->pack_slip_motor == 1) {
|
||||
// $stickCount++;
|
||||
// }
|
||||
// if ($curStick->pack_slip_pump == 1) {
|
||||
// $stickCount++;
|
||||
// }
|
||||
// if ($curStick->pack_slip_pumpset == 1) {
|
||||
// $stickCount++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if ($row['motor_scanned_status'] == 1) {
|
||||
// $scannedCount++;
|
||||
// }
|
||||
// if ($row['pump_scanned_status'] == 1) {
|
||||
// $scannedCount++;
|
||||
// }
|
||||
// if ($row['capacitor_scanned_status'] == 1) {
|
||||
// $scannedCount++;
|
||||
// }
|
||||
// if ($row['scanned_status_set'] == 1) {
|
||||
// $scannedCount++;
|
||||
// }
|
||||
|
||||
// $this->packageCount += $stickCount - $scannedCount;
|
||||
// }
|
||||
|
||||
// if ($onCapFocus) {
|
||||
// $this->dispatch('focus-capacitor-input');
|
||||
// } else {
|
||||
// $this->dispatch('focus-serial-number');
|
||||
// }
|
||||
// }
|
||||
|
||||
public function loadData($invoiceNumber, $plantId, $onCapFocus = false)
|
||||
{
|
||||
$this->plantId = $plantId;
|
||||
$this->invoiceNumber = $invoiceNumber;
|
||||
@@ -93,80 +186,70 @@ class InvoiceDataTable extends Component
|
||||
$this->emptyInvoice = false;
|
||||
$this->hasSearched = true;
|
||||
$this->materialInvoice = false;
|
||||
// $this->showCapacitorInput = false;
|
||||
|
||||
// ->where('serial_number', '!=', '')
|
||||
$this->invoiceData = InvoiceValidation::where('invoice_number', $this->invoiceNumber)
|
||||
->where('plant_id', $plantId)->where('scanned_status', null)
|
||||
->get()
|
||||
->map(function ($record) {
|
||||
return [
|
||||
'sticker_master_id' => $record->sticker_master_id,
|
||||
'serial_number' => $record->serial_number,
|
||||
'motor_scanned_status' => $record->motor_scanned_status ?? '',
|
||||
'pump_scanned_status' => $record->pump_scanned_status ?? '',
|
||||
'capacitor_scanned_status' => $record->capacitor_scanned_status ?? '',
|
||||
'scanned_status_set' => $record->scanned_status_set ?? '',
|
||||
'scanned_status' => $record->scanned_status ?? '',
|
||||
'panel_box_supplier' => $record->panel_box_supplier ?? '',
|
||||
'panel_box_serial_number' => $record->panel_box_serial_number ?? '',
|
||||
'created_at' => $record->created_at,
|
||||
'operator_id' => $record->operator_id,
|
||||
];
|
||||
})
|
||||
->toArray();
|
||||
// Eager load stickerMasterRelation and item
|
||||
$invoiceRecords = InvoiceValidation::with('stickerMasterRelation.item')
|
||||
->where('invoice_number', $invoiceNumber)
|
||||
->where('plant_id', $plantId)
|
||||
->whereNull('scanned_status')
|
||||
->get();
|
||||
|
||||
$this->invoiceData = [];
|
||||
$this->packageCount = 0;
|
||||
|
||||
// Loop through and replace 'code' using related StickerMaster > Item > code
|
||||
foreach ($this->invoiceData as &$row) {
|
||||
foreach ($invoiceRecords as $record) {
|
||||
$sm = $record->stickerMasterRelation;
|
||||
|
||||
// Compute code
|
||||
$rowCode = $sm?->item?->code ?? 'N/A';
|
||||
|
||||
$stickCount = 0;
|
||||
$scannedCount = 0;
|
||||
|
||||
// $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
|
||||
$row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
|
||||
$curStick = StickerMaster::where('id', $row['sticker_master_id'])->first();
|
||||
if ($curStick) {
|
||||
if (Str::length($curStick->panel_box_code) > 0) {
|
||||
if ($sm) {
|
||||
// Panel box code
|
||||
if (Str::length($sm->panel_box_code) > 0) {
|
||||
$stickCount++;
|
||||
}
|
||||
if ($curStick->tube_sticker_motor == 1 || $curStick->tube_sticker_pump == 1 || $curStick->tube_sticker_pumpset == 1) {
|
||||
if ($curStick->tube_sticker_motor == 1) {
|
||||
$stickCount++;
|
||||
}
|
||||
if ($curStick->tube_sticker_pump == 1 || ($curStick->tube_sticker_pumpset != 1 && $curStick->tube_sticker_pump != 1 && $curStick->pack_slip_pump == 1)) {
|
||||
$stickCount++;
|
||||
}
|
||||
if ($curStick->tube_sticker_pumpset == 1) {
|
||||
$stickCount++;
|
||||
}
|
||||
} elseif ($curStick->pack_slip_motor == 1 || $curStick->pack_slip_pump == 1 || $curStick->pack_slip_pumpset == 1) {
|
||||
if ($curStick->pack_slip_motor == 1) {
|
||||
$stickCount++;
|
||||
}
|
||||
if ($curStick->pack_slip_pump == 1) {
|
||||
$stickCount++;
|
||||
}
|
||||
if ($curStick->pack_slip_pumpset == 1) {
|
||||
$stickCount++;
|
||||
}
|
||||
|
||||
// Tube stickers logic
|
||||
if ($sm->tube_sticker_motor == 1 || $sm->tube_sticker_pump == 1 || $sm->tube_sticker_pumpset == 1) {
|
||||
if ($sm->tube_sticker_motor == 1) $stickCount++;
|
||||
if ($sm->tube_sticker_pump == 1 || ($sm->tube_sticker_pumpset != 1 && $sm->tube_sticker_pump != 1 && $sm->pack_slip_pump == 1)) $stickCount++;
|
||||
if ($sm->tube_sticker_pumpset == 1) $stickCount++;
|
||||
}
|
||||
// Pack slip logic (only if tube sticker block didn't apply)
|
||||
elseif ($sm->pack_slip_motor == 1 || $sm->pack_slip_pump == 1 || $sm->pack_slip_pumpset == 1) {
|
||||
if ($sm->pack_slip_motor == 1) $stickCount++;
|
||||
if ($sm->pack_slip_pump == 1) $stickCount++;
|
||||
if ($sm->pack_slip_pumpset == 1) $stickCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($row['motor_scanned_status'] == 1) {
|
||||
$scannedCount++;
|
||||
}
|
||||
if ($row['pump_scanned_status'] == 1) {
|
||||
$scannedCount++;
|
||||
}
|
||||
if ($row['capacitor_scanned_status'] == 1) {
|
||||
$scannedCount++;
|
||||
}
|
||||
if ($row['scanned_status_set'] == 1) {
|
||||
$scannedCount++;
|
||||
}
|
||||
// Count already scanned
|
||||
$scannedCount += ($record->motor_scanned_status == 1) ? 1 : 0;
|
||||
$scannedCount += ($record->pump_scanned_status == 1) ? 1 : 0;
|
||||
$scannedCount += ($record->capacitor_scanned_status == 1) ? 1 : 0;
|
||||
$scannedCount += ($record->scanned_status_set == 1) ? 1 : 0;
|
||||
|
||||
$this->packageCount += $stickCount - $scannedCount;
|
||||
// Increment packageCount
|
||||
$this->packageCount += max($stickCount - $scannedCount, 0);
|
||||
|
||||
$this->invoiceData[] = [
|
||||
'sticker_master_id' => $record->sticker_master_id,
|
||||
'serial_number' => $record->serial_number,
|
||||
'motor_scanned_status' => $record->motor_scanned_status ?? '',
|
||||
'pump_scanned_status' => $record->pump_scanned_status ?? '',
|
||||
'capacitor_scanned_status' => $record->capacitor_scanned_status ?? '',
|
||||
'scanned_status_set' => $record->scanned_status_set ?? '',
|
||||
'scanned_status' => $record->scanned_status ?? '',
|
||||
'panel_box_supplier' => $record->panel_box_supplier ?? '',
|
||||
'panel_box_serial_number' => $record->panel_box_serial_number ?? '',
|
||||
'created_at' => $record->created_at,
|
||||
'operator_id' => $record->operator_id,
|
||||
'code' => $rowCode,
|
||||
'stickCount' => $stickCount,
|
||||
];
|
||||
}
|
||||
|
||||
if ($onCapFocus) {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// received_quantity → NUMERIC(10,6)
|
||||
|
||||
DB::statement(<<<SQL
|
||||
ALTER TABLE process_orders
|
||||
ALTER COLUMN received_quantity TYPE NUMERIC(10,6)
|
||||
USING received_quantity::NUMERIC(10,6);
|
||||
SQL);
|
||||
|
||||
// order_quantity → NUMERIC(10,6)
|
||||
|
||||
DB::statement(<<<SQL
|
||||
ALTER TABLE process_orders
|
||||
ALTER COLUMN order_quantity TYPE NUMERIC(10,6)
|
||||
USING order_quantity::NUMERIC(10,6);
|
||||
SQL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Schema::table('process_orders', function (Blueprint $table) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
DB::statement(<<<SQL
|
||||
ALTER TABLE process_orders
|
||||
ALTER COLUMN received_quantity TYPE NUMERIC(10,3)
|
||||
USING received_quantity::NUMERIC(10,3);
|
||||
SQL);
|
||||
|
||||
// order_quantity → NUMERIC(10,6)
|
||||
|
||||
DB::statement(<<<SQL
|
||||
ALTER TABLE process_orders
|
||||
ALTER COLUMN order_quantity TYPE NUMERIC(10,3)
|
||||
USING order_quantity::NUMERIC(10,3);
|
||||
SQL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Schema::table('process_orders', function (Blueprint $table) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
};
|
||||
@@ -13,6 +13,6 @@
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"postcss": "^8.4.47",
|
||||
"tailwindcss": "^3.4.13",
|
||||
"vite": "^6.0.11"
|
||||
"vite": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Http\Request;
|
||||
use thiagoalessio\TesseractOCR\TesseractOCR;
|
||||
use App\Filament\Pages\CustomLogin;
|
||||
|
||||
|
||||
Route::get('/', function () {
|
||||
return redirect('/admin');
|
||||
@@ -25,8 +25,8 @@ use App\Filament\Pages\CustomLogin;
|
||||
]);
|
||||
});
|
||||
|
||||
Route::get('/part-validation-image/{plant}/{filename}', function ($plant, $filename) {
|
||||
$path = storage_path("app/private/uploads/PartValidation/{$plant}/{$filename}");
|
||||
Route::get('/part-validation-image/{filename}', function ($filename) {
|
||||
$path = storage_path("app/private/uploads/PartValidation/{$filename}");
|
||||
|
||||
if (!file_exists($path)) {
|
||||
abort(404, 'Image not found');
|
||||
|
||||
Reference in New Issue
Block a user