[Vuejs]-Vue โ€“ Laravel โ€“ SPA 500 (Internal Server Error)

0๐Ÿ‘

How did you get this query and what are you trying to do?
The with() method is to load model relationships eagerly. Also, the ', ' in the middle is quite invalid. As it should be an array of relationships OR one single string for a relationship.

$get = EmployeeObjective::with('corporateObjective:id,corporate_objective,corporate_objective_description', 
'employeeObjectiveKpa:id,employee_objective_id,department_objective_id,kpa_info,kpi_info,kpi_progress,kpa_weight,kpa_score_1,kpa_equal,created_at')

Are these just properties of the EmployeeObjective? Use select() for that. Also, you have colons in there, why?

Also, if i am correct, you can return the result of the query immediately. No need to call the response method as it will automatically JSONify your result when returned.

0๐Ÿ‘

I think this solves everything. php artisan config:cache

Source: https://github.com/laravel/framework/issues/25964

Can anyone explain this solution?

Leave a comment