Support the ongoing development of Laravel.io →

4,311 Threads

posted 7 years ago

eloquent relation definition with condition

Hello, I have a relation like this : A - id - fields - X B - same id as A - fields C - same id as...

0 Likes
1 Replies

Distinct returns wrong count in Laravel 5.4

I am using Laravel 5.4 and MYSQL I have a table 'products' and a related attribute table 'products_a...

0 Likes
2 Replies

Check the status of a record in the Database and return a value

Hello everyone, I'm starting with Laravel and I'm really enjoying it. I need your help, I need to qu...

0 Likes
1 Replies
posted 7 years ago

filter query by method

Let's say that I want to retrive from database the list of artists that have recorded exactly 100 so...

0 Likes
6 Replies

Eloquent and Unions

Hi, I'm using Laravel 5.1 It is possible to construct this query with eloquent ORM? SELECT SUM(CASE...

0 Likes
1 Replies

retrieving data for editing using a dynamic dropdown

I successfully created a two-level dynamic dropdown using buildings and rooms by following Hardik Sa...

0 Likes
1 Replies
posted 7 years ago

Eager Loading query executions

Hi all, According to laravel docs when we use $books = App\Book::with('author')->get(); foreach...

0 Likes
0 Replies

Eloquent Query pivot data

Hi, I am having problem with my query. I have 4 tables users,prospects,leads,items. All of them rela...

0 Likes
0 Replies

Define a relationship as a union

Hi, I would like to know if there is a way to define a relationship as a union of two tables? I've a...

0 Likes
1 Replies

Laravel 5.4 Database Placement Questions

I know how I can get the data needed, but want to follow Laravel/MVC practices here and new to it. I...

0 Likes
1 Replies
posted 7 years ago

How would you go to create a relationship between 3 tables having a forth pivot table. Laravel 5.4

How would you go to create a relationship between the following tables: Users table: Schema::cre...

0 Likes
1 Replies

what should contain in pivot table

I'm trying to use pivot table. But I'm confused how should I define my database tables. Concept: Pac...

0 Likes
1 Replies
Solved

[L 5.4] how to forbid multiple responses

Hey guys! In my applicatio, every logged in user can open a "feedback-site". That site has...

0 Likes
1 Replies

How to use laravel application as both web application and Rest API

I am implementing a laravel web application and I separately implementing native mobile application...

0 Likes
4 Replies

Updating a model doesn't work when specifying a morphMany relationship in the withCounts attribute

Has anyone ever run into an issue where you can create records just fine, but the moment you want to...

0 Likes
0 Replies

opposite eloquent method to grabbing related data

I am looking for the opposite of getting all Data that is related in a many to many relations, thus...

0 Likes
5 Replies
Solved

Laravel Eloquent using 'with' and 'where'

Laravel 5.4 I am having a hard time using "with" and "where" together. Instead o...

0 Likes
0 Replies

save() function doesn't work and does not output an error

Hello, I am experiencing a strange problem with the built-in User class in Laravel. Its save() funct...

0 Likes
10 Replies
Solved

Laravel Adding Bulk data in Polymorphic Relationship

Suppose we have this schema: Set id name Question questionable_type questionable_id...

0 Likes
0 Replies

Set default MySQL timezone on connect?

There is a system timezone setting in the app.php config file, and that sets the PHP session timezon...

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