2 Commits

Author SHA1 Message Date
077872d418 Merge pull request 'Added invoice upload directory creation logic' (#291) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #291
2026-02-03 06:49:45 +00:00
dhanabalan
79f09236ab Added invoice upload directory creation logic
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
2026-02-03 12:19:25 +05:30

View File

@@ -52,7 +52,15 @@ class TestingTempResource extends Resource
$set('attachment', null); $set('attachment', null);
if (! $plantId) { if (! $plantId) {
$set('ivPlantError', 'Please select a plant first.'); $set('ivPlantError', 'Please select a plant first.');
} else {
$plantCode = Plant::find($plantId)?->code ?? null;
$directory = "uploads/temp/{$plantCode}";
if (! Storage::disk('local')->exists($directory)) {
Storage::disk('local')->makeDirectory($directory);
}
} }
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
}) })
->extraAttributes(fn ($get) => [ ->extraAttributes(fn ($get) => [