Support the ongoing development of Laravel.io →

4,311 Threads

Call to undefined method Illuminate\Database\Query\Builder::findBySlugOrFail() -- Please Assist

<?php namespace App; use Cviebrock\EloquentSluggable\Sluggable; use Illuminate\Database\Eloquen...

0 Likes
0 Replies

Laravel 5.3 with datatable adding id to table row

Hello, I'm busy learning Laravel. How can I add an id to a row in a datatable in laravel 5.3? The id...

0 Likes
1 Replies
posted 7 years ago

whereHas returns empty after upgrade to mysql 5.7

I'm working on an app written in laravel 4.2, running on mysql 5.5. After an upgrade of mysql to ver...

0 Likes
1 Replies
Solved

How to create relationship between Employee Department and Emp_dept table

Hello Everyone, I am troubling creating relationship between employees, departments and emp_dept tab...

0 Likes
1 Replies
posted 7 years ago

Eloquent: Array key value pair

Hello, using eloquent as stand alone in my app. Trying to select two columns and return an array whe...

0 Likes
1 Replies

Looking for Eloquent equivalent to this basic query using "DISTINCT"

SELECT DISTINCT user_id FROM picks WHERE weeknum = 1 I'm having a hard time finding examples using &...

0 Likes
6 Replies
Solved

How can I create Scout search function with several models with relationship?

Hi All, I have build a simple Scout function with Algolia. However, if there is relationship with ot...

0 Likes
0 Replies
posted 7 years ago

How do you handle models with distant relationships?

I have a Restaurant model with many Location models. Location models can have many Menu models. Menu...

0 Likes
0 Replies

Trying to solve this polymorphic many to many relationship.

So. This is one of those "Well that escalated quickly" type projects. You start with basic...

0 Likes
0 Replies

Database Query ROUND delivers wrong value

Btw. I'm using Lumen I have a table of events which have a LAT and a LNG each. Then I want to delive...

0 Likes
0 Replies

Defining Multiple Relationships

Hello, I'm trying to define a relationship where one user has many different roles. An user can sign...

0 Likes
0 Replies

Maintaining only created_at or updated_at in an Eloquent model

Hi. I'm aware that this was often asked for in the past. There are basically two solution's that can...

0 Likes
2 Replies
Solved
posted 7 years ago

Get specific columns using 「with()」in laravel with appends fields in model

In my User model, I have an appends fields: protected $appends = [ 'is_admin' ];...

0 Likes
0 Replies

l5-repository query

Guys, good night. It's OK? I have a question that is difficult to solve. How would I make this query...

0 Likes
0 Replies

Table with multiple polymorphic fields

Ok so I have a table called payments which has two sets of polymorphic fields:- parent_id parent_typ...

0 Likes
0 Replies

login using user id in JWT Auth

Hi, I know , that exists way how to login users by theirs ids: Auth::loginUsingId($user_id) but how...

0 Likes
1 Replies
Solved
posted 7 years ago

Relation between 3 tables?

I have following tables: users (classic laravel table) events user_events in user_events I insert...

0 Likes
2 Replies
Solved

How to insert (multiple) two related table into a single query

i have to table which is Order and Product orders table: id, order_name products table: id, orders_i...

0 Likes
0 Replies

Orderby with nested relationship

Hello, I have a model with 2 levels relationship, and I would like to order by id from 2nd level. My...

0 Likes
0 Replies

Route Model Binding with Repositories

Hi, I have an application where there are multiple subdomains (portals) running from a single instan...

0 Likes
4 Replies
Solved

Thanks to our community

Solutions given in the past year. Excluding solutions from thread authors.

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.