Support the ongoing development of Laravel.io →

4,311 Threads

Carbon mysql persistence

I have a datetime attribute that I want to convert to Carbon and persist it to mysql as a Carbon obj...

0 Likes
1 Replies
posted 9 years ago

get profile image for poster

User Model function comments(){ return $this->hasMany('Comment'); } function posts(){...

0 Likes
0 Replies

Sentry 3 Users Online

Hey guys, Since on my old topic (http://forumsarchive.laravel.io/viewtopic.php?id=10766) the links a...

0 Likes
9 Replies

Check if table exist, if not create table

Hello everyone, I made a code which i used to check if a table exists or not. If not the code would...

0 Likes
1 Replies

Eloquent nested polymorphic relationship

I have a polymorphic relationship set up between the comments and the video / images tables. Now i w...

0 Likes
5 Replies

Best Praxis, Controller has Model with static an public methods

Ahoi, want to use static methods and public method (of Instance) from a Model. have a controller : c...

0 Likes
1 Replies
Solved
posted 9 years ago

how to call controller method to model?

how to call controller method to model? OrderController: public function mailInvoice($id) { //...

0 Likes
6 Replies

Controlling open connections to DB

Hi, I'm using Eloquent ORM outside of laravel. Its with SLIM Framework. I'm trying to control the nu...

0 Likes
0 Replies

A better way to make this?

Hello, I am looking to improve my code for better performance, how would you optimize this code: pub...

0 Likes
3 Replies

Eloquent optimization

Hi, I have a small question, I have a website where they are teachers who can add students. Students...

0 Likes
1 Replies

insert or update multipile rows

I have this code: $sqlInsert = array( array('id'=>1, 'temp'=>1), array('id'=>2, 'te...

0 Likes
13 Replies

Order paginated results by HAVING on related model

I have 2 tables: User [ id, name, address_id, active ] Address [ line1, line2, city, county, postcod...

0 Likes
0 Replies

How to merge two eloquent collections?

I have a questions table, and a tags table. I want to fetch all questions from tags of a given quest...

0 Likes
1 Replies
posted 9 years ago

$this in user model always returns signed in user

Hi all, I was trying to add gravatars to all my users, so i created the function getImageAttribute()...

0 Likes
0 Replies

Adding brackets in join > where

Hi all, Due to the lack of "WHERE IN" for joins, I'm trying to add a bracketed 'OR WHERE'...

0 Likes
1 Replies
posted 9 years ago

belongsTo and HasMany relationship

users : id, username, password images : id, user_id, isprofile (0,1) and so on Image model publi...

0 Likes
3 Replies
posted 9 years ago

Respond JSON of Object including relations

Hey there, I want to respond to a GET request for an object id with the requested object and all its...

0 Likes
2 Replies
Solved

informix connection with laravel

I find no way to connect with informix through eloquent?

0 Likes
1 Replies
posted 9 years ago

Found an interesting bug

I found an interesting bug which I'll share here. Hopefully it will save someone time. Consider this...

0 Likes
0 Replies

Attribute casting, Date Mutators on pivot table of related models

Sorry for this crosspost, I already asked my question on Laracast, but no response came, that's why...

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.