Attempt to read property "budget" on null
I'm having this issue where it throws this error on this piece of code
The property budget is not null and is read.
if I it shows the correct value
if I it shows obviously
$project = Project::find(request()->route()->parameter('project'));
$budget = (int) $project->budget; $project = Project::find(request()->route()->parameter('project'));
$budget = (int) $project->budget;The property budget is not null and is read.
if I
dd($budget)dd($budget)if I
dd($project)dd($project)App\Models\Project {#2355 ▼ // app/Filament/Condivisore/Resources/QuoteResource.php:56
#connection: "mysql"
#table: "projects"
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#withCount: []
+preventsLazyLoading: false
#perPage: 15
+exists: true
+wasRecentlyCreated: false
#escapeWhenCastingToString: false
#attributes: array:10 [▼
"id" => 7
"user_id" => 1
"title" => "Cerco un programmatore"
"slug" => "cerco-un-programmatore"
"banner" => "immagini-progetti/1/cerco-un-programmatore/banner/01HHHRMQWPP5T5E77MARYEWGNE.png"
"images" => "["immagini-progetti\/1\/cerco-un-programmatore\/immagini\/01HHHRMQYSV36TB4DF965ZFV1N.png","immagini-progetti\/1\/cerco-un-programmatore\/immagini\/01HHHRMR03WZH ▶"
"body" => "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ac diam turpis. Sed hendrerit mauris venenatis tortor volutpat, quis vulputate justo co ▶"
"created_at" => "2023-12-13 14:17:42"
"updated_at" => "2023-12-13 14:17:42"
"budget" => "25000"
]
#original: array:10 [▶]
#changes: []
#casts: array:1 [▼
"images" => "array"
]
#classCastCache: []
#attributeCastCache: []
#dateFormat: null
#appends: []
#dispatchesEvents: []
#observables: []
#relations: []
#touches: []
+timestamps: true
+usesUniqueIds: false
#hidden: []
#visible: []
#fillable: array:7 [▼
0 => "user_id"
1 => "title"
2 => "slug"
3 => "banner"
4 => "images"
5 => "body"
6 => "budget"
]
#guarded: array:1 [▼
0 => "*"
]
#queuedTags: []App\Models\Project {#2355 ▼ // app/Filament/Condivisore/Resources/QuoteResource.php:56
#connection: "mysql"
#table: "projects"
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#withCount: []
+preventsLazyLoading: false
#perPage: 15
+exists: true
+wasRecentlyCreated: false
#escapeWhenCastingToString: false
#attributes: array:10 [▼
"id" => 7
"user_id" => 1
"title" => "Cerco un programmatore"
"slug" => "cerco-un-programmatore"
"banner" => "immagini-progetti/1/cerco-un-programmatore/banner/01HHHRMQWPP5T5E77MARYEWGNE.png"
"images" => "["immagini-progetti\/1\/cerco-un-programmatore\/immagini\/01HHHRMQYSV36TB4DF965ZFV1N.png","immagini-progetti\/1\/cerco-un-programmatore\/immagini\/01HHHRMR03WZH ▶"
"body" => "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ac diam turpis. Sed hendrerit mauris venenatis tortor volutpat, quis vulputate justo co ▶"
"created_at" => "2023-12-13 14:17:42"
"updated_at" => "2023-12-13 14:17:42"
"budget" => "25000"
]
#original: array:10 [▶]
#changes: []
#casts: array:1 [▼
"images" => "array"
]
#classCastCache: []
#attributeCastCache: []
#dateFormat: null
#appends: []
#dispatchesEvents: []
#observables: []
#relations: []
#touches: []
+timestamps: true
+usesUniqueIds: false
#hidden: []
#visible: []
#fillable: array:7 [▼
0 => "user_id"
1 => "title"
2 => "slug"
3 => "banner"
4 => "images"
5 => "body"
6 => "budget"
]
#guarded: array:1 [▼
0 => "*"
]
#queuedTags: []