Support the ongoing development of Laravel.io →

4,311 Threads

Sorting Related Models By Their Related Model

I have the following relationships between my models Member public function memberships() {...

0 Likes
0 Replies

Combining fields and returning

New to laravel, coming from codeigniter and i'm trying to port over and clean up my project. I have...

0 Likes
2 Replies

What kind of database for big data?

Hi, i used to use laravel with mysql on hostings. Never use AWS or managed a Server by myself. For a...

0 Likes
3 Replies
Solved

Run api in default 80 port..

I have given my api code below: Step1: My Route $api->version('v1', function($api) { $api->get...

0 Likes
1 Replies

How to call Model without namespace in View?

Is there a way to call models in view like this $blogpost = new Blogpost(); without namespace? I don...

0 Likes
3 Replies

groupBy id in pivot tables

I have the next tables: producto recurso_web producto_recurso_web So in my Producto model I have t...

0 Likes
1 Replies

Get item by item_id from LengthAwarePaginator?

How can i get item by it is id from LengthAwarePaginator? I have tried something like this: {{$categ...

0 Likes
3 Replies
Solved

Laravel sync hasMany and belongsTo in reverse?

Is there a simple way to do a "sync" (as per a many-to-many) relationship in one line betw...

0 Likes
0 Replies

Count of occurrence in each row?

Hi guys , I am importing an .xlsx file to a mySQL database. For reach row, I would like to count the...

0 Likes
1 Replies

Loading model factories from vendor packages

https://github.com/laravel/framework/issues/11881 Yesterday I discovered a model factories but I got...

0 Likes
0 Replies

Generate dynamic URL?

Laravel 5.3 I have search results, need to do results per page. URL is dynamic. Depends on search r...

0 Likes
0 Replies

Laravel Pagination with Eloquent Result

Hello , I'm trying to paginate with eloquent but I am no been success . If I paginate like this , It...

0 Likes
4 Replies

Laravel 5.3 why SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails?

I have product, and it has many comments, why i cant delete product, with all of this comment? My Aj...

0 Likes
1 Replies
Solved

Ho to Paginate search results?

I have own search filter, like that: public function search(Request $request, $counter = 5){ $sear...

0 Likes
2 Replies
Solved

BadMethodCallException in Macroable.php line 52: Method shuffle does not exist. - after running composer update

Hi all, I just updated my dependencies (composer update) on my current project to their most recent...

0 Likes
1 Replies
posted 7 years ago

Set id as the index of relations array

Hi I have model with relation: $u = $user->with('Articles')->first(); then i can get: $u->...

0 Likes
0 Replies

Many-to-many and pivot - what are the benefits?

In my application I have a model User which can have many List, but a List can only have one User....

0 Likes
0 Replies

Getting model reference in an trait

Guys, good afternoon! I use Laravel and I have the following problem: Whenever a user edit a record...

0 Likes
0 Replies

How do I use the ModelFactory for seeding data if my data is not from Faker?

Hello, Ok, so I am trying to seed data into a table, below is what I have tried: $factory->defin...

0 Likes
1 Replies

problem with model->save() when running phpunit test

I have a problem with phpunit testing. I have an api that takes some json and saves a model (->sa...

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