Support the ongoing development of Laravel.io →

4,311 Threads

posted 10 years ago

Problems with Eloquent ORM, namespaces and "with" function

I have this models: app/Models/Instance.php <?php namespace App\Models; use Eloquent; class I...

0 Likes
1 Replies

Using model scopes gives Method not found

I'm having a bunch of trouble with model scopes. I have one scope that works properly, called direct...

0 Likes
4 Replies
Solved
posted 10 years ago

Polymorphic relations and hasMany relations for the same record

I'm trying to setup polymorphic relations for the first time. I have 4 models: Category, Image, Tip...

0 Likes
0 Replies
posted 10 years ago

Retreving ID after creating Polymorphic relation

Hi, I'm trying to retrieve an id after creating a Polymorphic relationship. Here is my code: $cat...

0 Likes
1 Replies

How to sync() more than the primary keys?

I have a many to many relationship setup like this: Product Model: public function skus() { return...

ostap liked this thread

1 Likes
1 Replies

Allow user to manage ONLY their own items

Hello, I am new to Laravel and have a small issue... I have an app set up with a front-end [for list...

0 Likes
5 Replies

Listing data with whereExists

I'm currently working on a browser game built with Laravel to get into laravel more. I'm currently r...

0 Likes
2 Replies

Query Builder to Eloquent

Hi, How can I convert this Query Builder Statement in Eloquent? return \DB::table('province')->jo...

0 Likes
5 Replies

Inforce an orderBy on a Model

I have a model where I always want the results to orderBy a certain way. Is there a way to enforce...

0 Likes
5 Replies

Status updates by Friends

Hey fellow Laravel friends, I'm trying to build status updates like Facebook. But my question is how...

0 Likes
3 Replies
posted 10 years ago

Laravel. Secure pages for logged in users

Hi; I set up the authentication page and it seems to be working fine, would u please check confirm I...

0 Likes
4 Replies

Eloquent class all() function causing server error 500

So I have a table on my database, with an eloquent class allowing me to access it. So far everything...

0 Likes
0 Replies
posted 10 years ago

Is there eloquent model postLoad event?

Hi. I want to do something after table row loaded. Is there eloquent model postLoad event? Like doct...

0 Likes
0 Replies

whereIn error: Prepared statement contains too many placeholders

I have a simple query like this: $userIdLists = Users::whereIn('id', $idList)->select(array('id')...

0 Likes
2 Replies
Solved

Error while reading from array

I'm trying to make simple example of reading data from multiple sources, storing that data in associ...

0 Likes
1 Replies
Solved

Laravel is crazy

Long story short. I created a migration named "create_music_table" which have following fi...

0 Likes
3 Replies

using groupby for display

I have the following tables set up widgets table: id, name, widget_types_id widget_types table: id n...

0 Likes
1 Replies

Many to many relation needs refresh after attaching new records?

I am writing an app that administers tests to students. I have a model that represents a prototype o...

0 Likes
1 Replies

Retrieve Data from 2 Tables

$orders = DB::table('orders') ->join('order_item', function($join) { $join->on('orders.id', '=...

0 Likes
1 Replies

Why is this eagerly loaded relationship returning me an empty array?

I have the following tables: lessons - lessonID - lessonName .. sections - sectionID - lessonID ref...

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.