Support the ongoing development of Laravel.io →

4,311 Threads

how can get hasbelongsToMany and send data to view

$employee=Employee::create([ 'name' => $request->get('name'), 'lastname' => $request-...

0 Likes
2 Replies
Solved

How to do not delete pivot table row

Hi, I have two tables; Table user and table user_groups. I'm using soft delete to delete users. When...

0 Likes
2 Replies
posted 8 years ago

belongtomany returns null

I am trying to do a belongsToMany relationship but it always returns null. These are my models. (piv...

0 Likes
4 Replies

show remaining and occupied

I am struggling with something and I really need some help The web application I am putting it toget...

0 Likes
1 Replies

response()->json differs on OS

So I have this odd problem with json. It will return different jsons depending on my underlying syst...

0 Likes
0 Replies

Laravel eloquent - how to use DB raw inside custom relationship

I have laravel models : Post and Comment. As normal, post will have many comment tables as bellow: P...

0 Likes
1 Replies

Compare Properties of Multiple Collections

How can I compare properties of multiple collections. I have the following code. $games = Schedule::...

0 Likes
3 Replies

Class 'App\Song' not found

So I've been following https://laracasts.com/series/laravel-5-from-scratch/episodes/8 and I've got t...

0 Likes
3 Replies
Solved
posted 8 years ago

Does getDictionary() return accessor values?

And if it is not possible how can I create map with accessor values?

0 Likes
0 Replies

One-to-many polymorphic relations

Hello, I'm familiar with many-to-many polymorphic relations explain here: http://laravel.com/docs/5....

0 Likes
1 Replies

Hierarchical relation checking

I have a model A which has a parent/child relation with itself through a pivot table AHasA. Model A...

0 Likes
1 Replies

Eloquent, Postgres, and the JSON datatype

Has anybody worked with eloquent/postgres and the json/jsonb datatype? I've fleshed out some basic c...

0 Likes
7 Replies
Solved

How to get (Client::with->last 10 activities) in one Eloquent collection

Hi everyone. I'm not sure if it's possible but here is my question: How to get all my clients with t...

0 Likes
4 Replies

Custom Helper functions using URLGenerator?

I am new to Laravel/OOP and am trying to reproduce a legacy site where there is a back button with v...

0 Likes
4 Replies
Solved
posted 8 years ago

Eloquent events on related models saving.

Hi guys! I've got two models - Parent and Child with one to many relationship. I'm saving a new chil...

0 Likes
1 Replies

Places with distinct currency rates (some kind of smart eloquent query)

Hello, I have an app that should list points with its exchange rates. Basically, there are 2 main ta...

0 Likes
0 Replies

Illuminate\Database\Eloquent\Factory bug

In my testcase when I try to create a model by factory like the following $factory->defineAs(App\...

0 Likes
2 Replies
posted 8 years ago

How to get items in a hierarchical category

Men (parent_id 0) Men 1.2 -- Men 1.3 (2 product) ---- Men 1.4 (1 product) I need to get all items...

0 Likes
2 Replies
posted 8 years ago

Override find()

I'm trying to override the find method, but for some reason it's stuck in an endless loop. It's the...

0 Likes
3 Replies
Solved

Combine multiple queries

I try to make a search engine for users. The search will be with multiple fields so as the user can...

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.