Support the ongoing development of Laravel.io →

988 Threads

Create multiple objects at once

Hi community, I want to create multiple objects with a single click, I want to be able to create a G...

0 Likes
1 Replies
Solved

Optimize sql Query

Hi I have one scenrio. their is static content in database table. My table look like this. id ti...

0 Likes
1 Replies
Solved

How to order the first table by a column in the second table

Hi, i have a little problem trying to order the first table based on the second table column. Table:...

0 Likes
2 Replies
Solved

How to return a single value from a scope?

This is what I have done so far: public function scopeCityName($query) { return $query ->join...

0 Likes
1 Replies
Solved

Getting hasMany relationship data from hasOne relationship

Hi All, New to Laravel and MVC so I'm a bit stuck and hoping I can get a solution from you. I have 3...

0 Likes
4 Replies
Solved

"Depth to great" when querying relations

I get the message "depth too great" when querying a couple of relations. These are my mode...

0 Likes
2 Replies
Solved

Dynamic validation rules

I need to have some validation rules based on configuration files (those at app/config), so the rule...

0 Likes
2 Replies
Solved

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

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

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

How to "split" an Eloquent request construction ?

Hi. I am trying to do something like this : $name = Input::get('name'); $keywords = explode(' ', $na...

0 Likes
2 Replies
Solved

Getting data of model related as an array

Hi... maybe it's a newbie question... these are my first steps with Laravel.. suppose I have in Post...

0 Likes
2 Replies
Solved

Filtering Results in RestAPI with attributes from a related model

I'm currently building a REST API with laravel. I'm trying to implement filtering of results on a ro...

0 Likes
2 Replies
Solved

Can you use sum() or something like it in a whereHas() statement?

I have a model called 'Charges' which stores charges made by someone. I want to sum all the charges...

0 Likes
1 Replies
Solved
posted 10 years ago

How to determine if model support soft deleting?

Hello, is there a native way to determine if a model supports soft deleting? Something like: User::u...

0 Likes
2 Replies
Solved
posted 10 years ago

Checking if friends.

I want to check if people are friends. I want to check if in a row both the authenticated user exist...

0 Likes
5 Replies
Solved

Database query: nested object

Hi, I am trying to create a beautiful API. Lets assume we have 2 tables, relationship one-to-many (a...

0 Likes
2 Replies
Solved

Model Observer And Events When Create

There are two ways to create new record in laravel $model = new MyModel; $model->field1 = 'value1...

0 Likes
1 Replies
Solved

Models properties

How do i make eloquent: NOT assume that my primary key is only named 'id' set the $timestamps prope...

0 Likes
8 Replies
Solved

getting id from a join

i have this join statement : Item::join('buttons', 'items.cta_id','=','buttons.id')->where('build...

0 Likes
2 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.