Support the ongoing development of Laravel.io →

4,311 Threads

Laravel Relationships - Getting Related Eloquent Objects in a query.

Hi All, I cannot find this in the docs or on SO, so i figured I would post my question here: I have...

0 Likes
1 Replies
Solved

Last record in Eloquent model

Laravel has a first method when accessing an Eloquent model, but is there a way to get the last reco...

0 Likes
1 Replies
posted 10 years ago

SQL Order By list of strings? but in Eloquent

I wonder if it is possible to order by list of strings using eloquent? http://stackoverflow.com/ques...

0 Likes
2 Replies
Solved
posted 10 years ago

Where to put thise because windows not support artisan tinker

Find By Id Using find() $post = Post::find(2); $post->setHidden(['content','read_more','updated_...

0 Likes
0 Replies

Nested query in FROM

Hi! I'm really newbie and I'm not sure how to do queries with Eloquent. My SLQ query is this: SELECT...

0 Likes
4 Replies
Solved

using alias in a join

i have this join: $mains = Main::join('builds', 'mains.build_id','=','builds.id')->where('builds....

0 Likes
1 Replies

using javascript to set a variabe

i have an form that is set to upload an image and update a database with the image data (if needed)....

0 Likes
2 Replies
Solved

How to get timestamp integer instead of Carbon object

My application has to adapt to an existing database which uses integer timestamps instead of string...

0 Likes
2 Replies
Solved

Please Help Me to get this solve

I want to display 'Recent Comments' from comments table, including HotelName related to that Comment...

0 Likes
1 Replies
Solved
posted 10 years ago

How can I access additional models from a pivot?

I have three primary tables, Accounts, Users, Roles. All accounts are owned by a user but not all us...

0 Likes
6 Replies
posted 10 years ago

Consuming JSON via REST

Looking at interest at Laravel as a PHP framework. I have a question relating to its ability to use...

0 Likes
0 Replies
posted 10 years ago

how do i prevent an attributes value being saved if its got an active Accessor?

I have a Product model in which I use a getPriceAttribute($value) to display a products discounted p...

0 Likes
4 Replies
Solved
posted 10 years ago

Relations in namespaced models

I started to move all my models to namespaced directories /app/lib/Acme/models, but noticed that whe...

0 Likes
1 Replies

Temporary file not found on model create?

Hi everyone, so what i want to happen is when the form is submitted, an image is uploaded and the mo...

0 Likes
0 Replies

Search through relationships

Hi! I have a little problem that I'm not quite sure how to solve it. To simplify, lets say that I ha...

0 Likes
4 Replies
Solved

Dynamic classes from eloquent

Hi everybody, I'm just getting started with Laravel and SOLID development, and I'm having trouble fi...

0 Likes
1 Replies

Mocking Model Binding

I'm new to writing test cases and I'm writing a test to see if the edit resource page is shown corre...

0 Likes
0 Replies

Resource authentication and session data

In my controller I have: public function __construct() { $this->beforeFilter('auth', array('excep...

0 Likes
2 Replies
Solved
posted 10 years ago

Laravel eloquent relationship

I have a table ranks as position player_id 1 77 2 99 3 12 and one more table players as id na...

0 Likes
4 Replies

Best practice for validating relationships using Ardent?

I'm working on an application containing log messages and users. The respective models are LogMessag...

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.