I’m trying to get a list of tasks that are associated with a specific client, but there is no direct relation between a task and a client. I also need to filter those tasks based on task status and …
Tag: eloquent-relationship
Laravel HasMany WhereNotIn Query
Problem: I’m trying to query a PeopleType to find all the courses where a person isn’t associated. I have 4 tables People PeopleTypes Courses People_Courses PeopleType_Courses I have the following …
Laravel one-to-many relationship with different column than primary key
I have following two tables: account: +————————–+———————+——+—–+———+——-+ | Field | Type | Null | Key | Default | …
Eloquent: Get ‘max’ values from a `hasMany` -> `hasOne` relationship
I have an interesting eloquent challenge and my knowledge is not quite there to work it through, hoping you smart folks can give me some guidance. I have read this: Getting just the latest value on a …
Pulling all categories and grouping them by parent id
I am working with Laravel data querying and I need a query that is going to group all the children of a parent when I take the categories. the categories table has a name and a parent_id, the routes of the categories have the parent_id set as null, the query should return every category grouped by parent id and the