0
votes
1answer
16 views

laravel help. Eloquent. Items that have comments > 2

im new to laravel. I have got a problem with getting the objects of: Items that have comments > 2. Just to be clear. one item have many comments.
0
votes
2answers
30 views

Performing a JOIN SQL method for this mentioned code

I have two tables company and company_meta company table has following ------------------------ id | title | city ------------------------ 1 | abc | nice city 2 | def | awesome city ...
0
votes
2answers
58 views

How to handle prepared statements/prevent SQL injection in Laravel 3 raw queries?

Is there any best practice on how to prepare raw queries in order prevent SQL injection? My code looks like this (simplified for example - actual query is more complex or I would just use Fluent API): ...
0
votes
1answer
92 views

How can I use UPDATE OR INSERT with Laravel 4?

I'm building an application in Laravel 4 and I need to run several queries as UPDATE OR INSERT queries to avoid PK violations on duplicate inserts. I haven't been able to find any way to do this with ...
0
votes
2answers
60 views

How to get a result from a query without the tag “stdClass Object” in Laravel?

I'm using Laravel v4.0 with MySQL. I'm making queries with Query Builder to retrieve the information to be managed by a controller. The problem is the result of any query contains a tag named stdClass ...
0
votes
2answers
54 views

“Three way” many-to-many relationship using Eloquent

I have a simple database setup: Users, Groups, Pages - each are many to many. See diagram: http://i.imgur.com/oFVsniH.png Now I have a variable user id ($id), and with this I want to get back a list ...
0
votes
1answer
80 views

Simple SQL to Eloquent Query (Laravel)

I have two tables: users (Users) and groups (Groups). Users ----------------- id | username | group 1 | Bob | 2 Groups ----------------- id | name 1 | ...
0
votes
1answer
88 views

Laravel 4 exclusive transaction with update and select

I need to select a row from a SQLite database that is set as free, and then mark the row as taken. It is crucial that the select and the update are an atomic operation and that there is no risk that ...
0
votes
1answer
74 views

Laravel Eloquent Select CASE?

Is there anyone with experience in PHP & Laravel Eloquent who can help me resolve this statement? I'm trying to inject a CASE... WHEN.. END... inside a raw() method. It seemed like it was ...
1
vote
2answers
164 views

Laravel. How do i write a fluent query for full text search?

I need to write a fluent query for full text search in Laravel 3.0. The search query goes like this SELECT * FROM posts WHERE MATCH (tags) AGAINST ('Lorem Ipsum Dolor Sit Amet'); I had been ...
0
votes
1answer
57 views

Performing a Groupwise Maximum in Laravel 4

What's the best way to perform a groupwise maximum using Laravel's Eloquent ORM such that it returns instances of models?
0
votes
2answers
44 views

How can I select tags from MySQL sorted by creation_date and name but remove duplicate name?

I'm using MySQL and Laravel 3. I have the following table: tags id INT name INT created_at TIMESTAMP tag names are not unique and tags are associated with another table called ...
0
votes
1answer
70 views

Laravel Eloquent ORM: trouble with one-to-many using belongs_to()

I'm having trouble accessing a relationship in Laravel. Relevant to this question, I have two tables, messages and users. The messages table looks like: Messages: id, user_from, user_to, read, ...
0
votes
1answer
35 views

Limit eager loaded comments

I want to load all my news with comments. Right now, I am retrieving all news with all comments. However, I only want 2 comments to be shown to each news item. $news = ...
0
votes
1answer
129 views

Complicated query using eloquent - Laravel 4

So I am making a web site for an simulated hockey league. I am trying to make the standings and this is where it gets complicated. There is 2 conferences. East and West. In each conference, there ...

1 2 3
15 30 50 per page