Support the ongoing development of Laravel.io →

4,311 Threads

Eloquent relationships - getting user id..

Just a quick one, i'm struggling to do relationships correctly.. I have 2 tables 'users' and 'files'...

0 Likes
5 Replies

HAS_MANY relationship shows a Phantom IS NULL in query log and returns no rows

here is what I have CONTRACTOR and BID table class Contractor extends Eloquent { public function bid...

0 Likes
1 Replies

How to add data to many-to-many polymorphic relation?

I have an Org model and a Tag model. I want to associate tags with organizations. My database tables...

0 Likes
3 Replies
Solved

Populating a select (DropDown) from DB

Hi, I am having trouble with populating a dropdown with values from a relationship. The code below w...

0 Likes
3 Replies
Solved

how to retrieve data from database using table formatting

how to retrieve data from database using table formatting

0 Likes
3 Replies
Solved

how object work?

$from = Att::Find(Input::get('pos')); $to = Att::Find(Input::get('to'));...

0 Likes
3 Replies

Using repositories and the create() method

Hi all, I have setup a repository to create a new resident. <?php namespace Crescent\Repos;...

0 Likes
3 Replies
posted 10 years ago

findorfail to get specific fields

How do I write a eloquent on getting specific fields or columns from the table? I have tried below,...

0 Likes
1 Replies
Solved

Simple Eloquent calls - save error

Hi .. new to Laravel here .. and learning Eloquent ORM. I have a jobs table. I have a Job.php model,...

0 Likes
2 Replies
posted 10 years ago

Use Eloquent relationships with another database

Hey, is it possible to use eloquent relationships with another external database connection? Example...

0 Likes
5 Replies
Solved
posted 10 years ago

Rotate Database Records Daily

I have a database table from which I'd like to pull a single row each day. Unfortunately, I need to...

0 Likes
0 Replies
posted 10 years ago

Model object doesn't retain attributes updating during Events

I have a Model object that uses Model Events to manage some data, like the custom primary key. When...

0 Likes
1 Replies

Exception: Object of class DateTime could not be converted to string

Hi! For a while now (I think probably since the update to Laravel 4.1) I sometimes get the Error Exc...

0 Likes
2 Replies

check if value exists in array

I have 2 queries and I want to check if values of one queries exists in array of other query. I have...

0 Likes
3 Replies

insert data from form to table but the data inserted row empty

insert data from form to table but the data inserted row empty what the problem?

0 Likes
8 Replies
Solved

Is it possible one query for 3 models?

I have 3 tables: posts, comments, and users. One post has many comments (one to many relation.) Ever...

0 Likes
4 Replies
Solved

is that query preferable?

Would you write a query like that? Or would you prefer to divide it somehow? Is it ok for that long...

0 Likes
0 Replies

Model Event not working

I have the following model: class ProjectTwitterStatus extends Eloquent { protected $table = 'proj...

0 Likes
3 Replies
Solved

Multiple relationships in Eloquent

Hi, i have 3 models User, Blog and Blogcomment. User <?php use Illuminate\Auth\UserInterface; us...

0 Likes
2 Replies

Replace method in Eloquent

Hello, I'm a newbie with the Laravel framework. Before I had build my old website in simply PHP with...

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.