Added permissions to view process order upload and download button
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 33s
Laravel Pint / pint (pull_request) Successful in 2m30s
Laravel Larastan / larastan (pull_request) Failing after 3m15s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 33s
Laravel Pint / pint (pull_request) Successful in 2m30s
Laravel Larastan / larastan (pull_request) Failing after 3m15s
This commit is contained in:
@@ -30,6 +30,8 @@ use Filament\Forms\Components\Select;
|
||||
use App\Models\Line;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use App\Models\Item;
|
||||
use App\Models\User;
|
||||
|
||||
// use App\Models\PalletValidation;
|
||||
// use Dom\Text;
|
||||
|
||||
@@ -286,10 +288,16 @@ class ProcessOrderResource extends Resource
|
||||
->disk('local')
|
||||
->directory('uploads/temp')
|
||||
->preserveFilenames()
|
||||
->visible(function() {
|
||||
return Filament::auth()->user()->can('view process order packing slip');
|
||||
})
|
||||
->reactive(),
|
||||
Forms\Components\Actions::make([
|
||||
Action::make('uploadNow')
|
||||
->label('Upload PDF Now')
|
||||
->visible(function() {
|
||||
return Filament::auth()->user()->can('view process order packing slip');
|
||||
})
|
||||
->action(function ($get, callable $set) {
|
||||
$uploadedFiles = $get('attachment');
|
||||
|
||||
@@ -377,6 +385,9 @@ class ProcessOrderResource extends Resource
|
||||
|
||||
Action::make('downloadAttachment')
|
||||
->label('Download PDF')
|
||||
->visible(function() {
|
||||
return Filament::auth()->user()->can('view process order packing slip');
|
||||
})
|
||||
->action(function ($get) {
|
||||
$equipmentNumber = $get('process_order');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user