Support the ongoing development of Laravel.io →

4,311 Threads

Null value for deleted_at to be '0' and not 'null'

As I have asked a few times before, I'm developing a website/CMS to a game server for which I can no...

0 Likes
6 Replies
Solved

Is there a way to order by data in a pivot table

Hi, I have a pivot table that links users to products. The table has timestamps that are updated wh...

0 Likes
1 Replies

best practices or common conventions around schema documentation?

Hi Laravel Community, As one of your newest members I'm curious if there's common conventions here a...

0 Likes
1 Replies

Why does model->delete not check the return from the database?

I was looking at the code in the delete method of the Model object in Model.php. The code eventually...

0 Likes
0 Replies
posted 10 years ago

How to model a 'MightHaveOneThrough' Relationship

I have a model where current_order_workflow_step is optional order_workflow_step is basially a join...

0 Likes
0 Replies

Eloquent Eager Loading combined with Select Statement

Hi, I want to do something like this: $channel = Channel::select(array( "id", "channe...

0 Likes
1 Replies
posted 10 years ago

slow query

select * from `posts` where (select count(*) from `categories` inner join `post_categories` on `cate...

0 Likes
1 Replies

How to cache specific related model info?

Hi, Let's say a User belongsTo a Language, and to make it simple here's the controller (no repo) : $...

0 Likes
6 Replies

running multiple queries

hi, is there any method to do a multiple queries. From what I want is around like this in mysql quer...

0 Likes
2 Replies

Query inside switch returns null

I have a controller with a method for when the user wants to soft-delete his record (Character model...

0 Likes
2 Replies

how to reset model deleteat_at to ''0000-00-00 00:00:00" ?

I notice that laravel use 0000-00-00 00:00:00 for deleted_at time ,So i change data deleted_at like...

0 Likes
5 Replies
Solved

Can't access Eloquent models from artisan command.

So I'm trying to do a very simple eloquent query, however both a select and an insert query fail. Th...

0 Likes
5 Replies

View data in Controller or View...

Hello, there. I have a table of users, and when you click on a Details button for a particular user...

0 Likes
1 Replies

How to make an 'orderBy' case-insensitive ?

Hi all, My question here is pretty simple but I didn't find the answer on the Web. I would like to s...

0 Likes
1 Replies
posted 10 years ago

Counting specific records through 'hasMany' relationship

Hi I have two models - node and content. Content belongsTo 'node' and Node hasMany 'content' - all p...

0 Likes
1 Replies

Dabase record regenerated does not contain the values of the model variable

Hi everyone, I'm new to Laravel and trying to catch up with a project as much as possible. I created...

0 Likes
1 Replies

dont show error if relation not exist , just show empty field.

Hi i have controller and i am taking data like this $events= Eventm::with('teacher')->get(); th...

0 Likes
1 Replies
Solved
posted 10 years ago

Returning array of ids

When inserting batch data how would you get a array of primary key ids from the inserted data $data...

0 Likes
1 Replies

Many to Many relationship generating sql with where clause looking for null

I am trying to create a Many to Many relationship with Eloquent but the SQL generated is checking my...

0 Likes
0 Replies
posted 10 years ago

Pivot table wherePivot

I got a function to find a friend request by friend pivot id. Code // Repository public function fin...

0 Likes
0 Replies

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.