Using updateOrCreate() with incrementing value

Is it possible? The code using NotORM library looks like this: $this->database->$table->insert_...
04

Get relational data of many to many relationship with multiple database connection

Laravel Version: 5.5. PHP Version: ">=7.0.0", Database Driver & Version: MySQL Description:...
01

Laravel 5.5 WhereIn query with null

return $places = Place::where('name', 'like', '%' . $request->name . '%') ->whereHas('eatCategories', function($q) use($kitchen){ $q->Wher...
01

Non-static method 'where' should not be called statically on PHPStorm

After updating my composer, I'm getting this warning on PHPStorm on the 'where' method of Eloquent. Non-static method 'where' should...
08

add paginators to related models

have the following code $parent_rows = $user->company->parent_table() ->with('first_child_table') ->whereHas('first_...
05

MongoDB Schema Validation

Hi Guys, I'm looking for schema validation package for MongoDB, any help?...
01

Self Join In Eloquent Model

Hi guys, i am stuck in functionality of building functionality like self Join, for example i may have categories and nested categories, in categori...
02

'Extending' Database Tables?

Let's suppose I have three different types of file uploads - each with their unique attributes, each used very exclusively of the others (for examp...
01

Get statuses with number of assigned tasks belonging to selected project

I have, a project which can have many tasks and each one of task can have one status assigned. Now when Im displaying tasks for selected project I...
03

Custom order of collection

I have used the merge() collection method to combine 3 different models collections that are Pages, Posts & Photos. So now I have collec...
08

Relationships for multiple value of foreign key in same column

hay, please help me I am in a state of confusion to connect a model relate to more than one foreign key in the same column. Example t...
04

Where In multiple columns

I have a table with something like this: dummies - id - morphable_type - morphable_id And i want to query thi...
07

getting a total sum from a table value from all records.

I am collecting a click count on a record. What I want to do is this, in my collection I want to get that total of all click from my table and sh...
02

__construct on child model

I have a User model and a UserProfile model. The User 'hasOne' UserProfile. public function profile() { return $this->hasOne('App\UserPro...
03

Polymorphic relation trought id

Hello, I got data structure from a legacy system and I try to create nice relation between them. products (for now 3 records related to foo,...
03

Loop query Eloquent with WhereDates()

Hi, I am trying to get the count of rows I have in the database for a specific table. The count of rows is defined by date, so I want to get...
01

Realtionships that require an authenticated User

Say you have a User Model. You also have a Products Model. Users can create private notes about products....
06

Strange insert error..Integrity constraint violation

Ok, whenever I am trying to insert column 'to_' using eloquent it gives me error integrity constraint violation but when I insert using DB::table i...
05

How to user foreignKey and ownerKey

I have a Grade model that belongs to a User. So in my User I have a function public function grades() { return $this...
01