Added disabled function on plant and item code
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 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 3m4s
Laravel Larastan / larastan (pull_request) Failing after 3m32s
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 13s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 3m4s
Laravel Larastan / larastan (pull_request) Failing after 3m32s
This commit is contained in:
@@ -12,6 +12,7 @@ use Filament\Facades\Filament;
|
|||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Components\Actions\Action;
|
use Filament\Forms\Components\Actions\Action;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
@@ -45,6 +46,7 @@ class GrMasterResource extends Resource
|
|||||||
->reactive()
|
->reactive()
|
||||||
->searchable()
|
->searchable()
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
|
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
$userHas = Filament::auth()->user()->plant_id;
|
$userHas = Filament::auth()->user()->plant_id;
|
||||||
|
|
||||||
@@ -56,6 +58,7 @@ class GrMasterResource extends Resource
|
|||||||
// ->relationship('item', 'id')
|
// ->relationship('item', 'id')
|
||||||
->reactive()
|
->reactive()
|
||||||
->searchable()
|
->searchable()
|
||||||
|
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
if (empty($plantId)) {
|
if (empty($plantId)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user