Attempt to read property "budget" on null

i'm having this error ' Attempt to read property "budget" on null ' when trying to submit this form. The form shows correctly the numbers and also min and max, but wen i try to submit it throws the error.
TextInput::make('quote')
->required()
->numeric()
->maxValue((int)$project->budget)
->minValue((int)$project->budget*0.4)
->prefixIcon('heroicon-s-currency-euro')
->prefix('Min. '.Number::currency($project->budget*0.4, 'EUR', 'fr'))
->suffix('Max. '.Number::currency($project->budget, 'EUR', 'fr'))
->label('Budget'),
Select::make('project_id')
->required()
->relationship(
name: 'project',
titleAttribute: 'slug',
modifyQueryUsing: fn (Builder $query) =>
$query->where('id', request()->route()->parameter('project'))
)
->preload()
->label('Progetto'),
TextInput::make('quote')
->required()
->numeric()
->maxValue((int)$project->budget)
->minValue((int)$project->budget*0.4)
->prefixIcon('heroicon-s-currency-euro')
->prefix('Min. '.Number::currency($project->budget*0.4, 'EUR', 'fr'))
->suffix('Max. '.Number::currency($project->budget, 'EUR', 'fr'))
->label('Budget'),
Select::make('project_id')
->required()
->relationship(
name: 'project',
titleAttribute: 'slug',
modifyQueryUsing: fn (Builder $query) =>
$query->where('id', request()->route()->parameter('project'))
)
->preload()
->label('Progetto'),
Any clue?
0 Replies
No replies yetBe the first to reply to this messageJoin