Support the ongoing development of Laravel.io →

4,313 Threads

Defining Two Relationships Between Models

I'm learning Laravel, and really OOP in general. I've followed several YouTube tutorial series, that...

0 Likes
0 Replies

Create new database and tables on the fly

Hi everybody. I want create dynamically new database, database user with privileges, tables in new d...

0 Likes
8 Replies

Renaming the pivot table Columns .

i have many to many relation in my database and i can't change the default name of the pivot table C...

0 Likes
0 Replies

Cannot insert third pivot column with sync method

My question is similar to this thread : Laravel relationship with a 3 column pivot table But it seem...

0 Likes
0 Replies

Using DB or Eloquent I got error Unsupported operand types

Excuse me, is there anybody can help me? 3 days, I still cant find any results by searching from int...

0 Likes
0 Replies

Get all relationships in many-to-many polymorphic

Hi, I am trying to build a form with dynamic fields. Fields are based on select box choice and can d...

0 Likes
0 Replies

Generate relation functions from array

This is a example of my model relation code today: public function Discipline() //relation { ret...

0 Likes
5 Replies

Order After Union an errors occurs

Script MySQL - Works correctly select * from ( (select agregados.nome as agregado, recursos.tipo, li...

0 Likes
0 Replies

Many-to-Many relation not working properly

I have three tables: Tournaments, Participants, Users. The structure is: Tournaments: -Id -D...

0 Likes
1 Replies

help secure query with like

Hi, this query can be injected using this text 'a% ' (remove quotes) $courses = Course::select('id',...

0 Likes
1 Replies

Laravel Outputs Different Output Than MySQL For Query

Hi, I generated a MySQL query which gives the correct output I require (tested on MySQL Workbench)....

0 Likes
1 Replies

Multiple Foreign Key Referencing to same primary key

Hey guys, I'm new to laravel and i have 2 tables Userand Task. Inside my Task table i have CreatorID...

0 Likes
0 Replies
posted 10 years ago

hasManyThrough with Many-To-Many?

Hi, Is it possible to do a "hasManyThrough" with "Many-To-Many" relationship (pi...

0 Likes
26 Replies

Upvote and Downvote System

i am creating a website where user will post a comment,i want to create a upvote and downvote syste...

0 Likes
1 Replies

laravel model find return null for existing id

I am facing this issues of model find for existing id that is returning null and showing below error...

0 Likes
0 Replies

Fetching view from DB

Hello!! I am new in Laravel society. :) And I stuck with something. I made view in database and I do...

0 Likes
5 Replies
Solved

Eloquent select data

Hello, I want to build a eloquent query which builds this output SELECT * FROM `banners` WHERE (`val...

0 Likes
2 Replies

syntax error when i try to execute this code using carbon

public function searchresult (Request $request){ $keyword = $request->name; $search = Mosque::wh...

0 Likes
2 Replies

Help on many to many relation to create form aproach

Hi, I have two tables (hotels, cars) and a many to many relationship to determine which cars ara ava...

0 Likes
0 Replies

One to many Definition and Foreign Key

I have seen on tutorials people declaring the foreign key on one to many scenarios and others do not...

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