[5.4] polymorph to polymorph relations

Is it possible to create a polymorphToPolymorph relationship? Lets say we have a table, with columns: personable_id pe...
12

OrderBy Relationship

Hello, Farvorite Model: ID, user_id, post_id Post Model ID, Title, created_at...
00

mb_strpos() expects parameter 1 to be string, object given

Dear all, I have one problem with my code and I am can't figure out what I was wrong, Here is my code $jobs_obj=Job::wit...
08

Eager loading with constrain

Dear all, I don't know what I am wrong this this query $jobs_obj = Job::with(['skills'=>function ($skill){ $s...
04

Pluck from a nested collection?

Hi, I'm trying to pluck the strand_id value from the following collection Illuminate\Database\Eloquent\Collection {#38...
05

(Polymorphic) One to One with Pivot Table

Hello everyone, I have this tables: Agent Employee Person I want the person with id 1 to have 2 record both in Agent and Emplo...
01

findOrFail not throwing 404 exception

Hey! I have this code in my project, and when it fails to find an industry, it just continues and then I get an error when I try to access a...
04

where and orWhere

I've the following eloquent query: Deposit::where('name', 1234) ->where('is_earning', true) ->orWhere(...
02

Query builder help

$results = \DB::select(' SELECT t1.shift_total,t1.shift_correct, t1.shift_incorect, t2.DT, date(t1.created_at) as dt_da...
04

Why does Eloquent select all?

In the Laravel debug bar I see the following example trace: select * from "users" 7.09ms /app/Http/Controllers/UsersContro...
05

Eager Loading returns empty

Hi, I have 2 models: article { articleId ... } image { id, article_id } so i add class Article extends Model {...
02

Using Carbon inside of an Eloquent Scope

I've got a database table for recurring tasks which contains (amongst others) a LastCompleted and a Frequency column, whe...
03

How to change more than 1 column in Db with Eloquent model

Hello! For example, i have user settings page, where user can change his name, last name and city and so on. I know how to do this for one c...
03

how to custom foreign keys? __toString() fatal error

Hi everyone, I have this model (claims.id = PK, claims.claim_type_id = PK): class Claim extends Model { protected $table = 'clai...
01

Showing Data in Modal

Hello All, I am trying to get some data into a modal but it is not allowing me to do it no matter what I do, not sure what I have done diffe...
14

Relationship help - Coach -> Teams -> Players

Hi, I have a relationship that I just can't seem to get right. My models are setup with a many to many relationship between Coaches a...
04

Method does not exist

Hello Everyone, I am trying to display some results in a view but I am getting the below error: Method service does not exist...
33

Eloquent whereDate query give different than expected result

I have query where i need to select using whereDate function, here is my query. $histories = History::where('location_id', 71)->w...
01

Order By Relationship

Hi, One user has many workouts. I like to show all users in a list and sort them by the workout start time and speed. How could I do that?...
05