UPDATE: POST applynow applynow AppHttpControllersHomeControllerapplynow UPDATE 2. relationships Model::with query flipkickmedia posted 7 years ago Eloquent Im. I dont see anything wrong with the routes but yet cant find the problem. Please note, this example will not include any steps for creating database. If the relations are nested only a single level deep then it should not be a problem. The requested URL /applynow was not found on this server. Then handle saving all the relations of account in UserAccount component. Split the component into two: one for user and another component for user account. Make sure you are not omitting the 'createdat' or 'updatedat' fields in some rows in your database, which are required if that is the case delete the records where they have those empty fields or enter a value in the valid timestamp format, example ' 15:18:53'. In the mount() method public function mount() if record found it will update the number of rows and the indexing otherwise it insert all fields. The problem is that $this->user->account is having other relations and the save will fail with SQLSTATE: Column not found: 1054 Unknown column 'professions' in 'field list'Īs pointed out by OP- himself, ensure that all the relations are loaded (all relations which are used, updated in the component). Viewed 975 times 0 Hi im using this to insert or update a record based on 3 values. $this->user->avatar = $this->upload->store('files', 'public') Īs per Livewire docs - nested data, you can save the related model $this->professionGroups = Profession::get() $this->occupationGroups = OccupationGroup::get() Work flow:-You can simply get the conditional records ides in array ( Now you have an array of ides) and then use whereIn() to update multiple records which belongs to that ides at ones. $this->specialistations = Specialisation::get() How can I update this relations in livewire on submit? I have created a Livewire Form which includes couple of deep nested relations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |