Support the ongoing development of Laravel.io →

4,606 Threads

Ordering by the count of a related table result

The setup. I have Posts items that users can favourite. I show the count of how many people have fav...

0 Likes
4 Replies
Solved
posted 10 years ago

How specify columns with using ::with() ?

Hi everyone! I try this code: $urls = Url::with(['user' => function($query){ /** @var $query \I...

0 Likes
3 Replies
Solved

Paginate Encrypted Data

My DB is like 2000 records, the info is encrypted, using Crypt in my model... /* NAME*/ public func...

0 Likes
0 Replies

Adding Column to DB Table

I have an existing blog application, and I would like to add a way to have different types of blog p...

0 Likes
1 Replies

use laravel with record locking

I have a multi-tenant DB that I need to manage incrementing invoice numbers per tenant. It's import...

0 Likes
0 Replies

Eloquent relation

Hello ! I have two models, who have a one-to-many relationship. 1 - a company has many initiators 2...

0 Likes
3 Replies
Solved

can we find a row based on foreign key??

Suppose we have two tables abc and def. id is primary key of both tables. abc_id is foreign key of d...

0 Likes
4 Replies

What are the typical things I have to do in order to keep the app secure up and running?

Hi, This is the first time I am hosting sites on Digital Ocean. Everything is set up and working wit...

0 Likes
1 Replies

Using a variable in join function

Hi, I need to perfom a query which includes a join on multiple conditions. Therefore, I try to do th...

0 Likes
4 Replies
Solved

In-query check or code check

Hey, Quick question here! I don't really know what are the best practices on that subject, so I'll l...

0 Likes
4 Replies
Solved
posted 10 years ago

How can I replicate this SQL with the query builder?

This is part of a union MySQL query I'm using in my current project: SELECT DISTINCT NULL AS id, i1....

0 Likes
2 Replies
Solved

Best way of using model event and eloquent guard

I currently have a form with 3 dropdown menu which allow a user to select his date of birth by day,...

0 Likes
0 Replies

Scope Applicator - a package for easy data filtering and sorting

Hi. Check out a new library for data filtering in Laravel 4. It applies named scopes according to UR...

0 Likes
0 Replies
posted 10 years ago

Re-using parts of methods

Please excuse my lack of terminology. Because I know what I want to ask. But I don't know what it's...

0 Likes
3 Replies
posted 10 years ago

Unable to chain static model methods.

Hello, I am trying to use following code (inside user model) public static function onlyActive()...

0 Likes
4 Replies
Solved

Pivot Table relationship

I am having problems with creating a schema / model for one of my projects and would like to get som...

0 Likes
3 Replies

Using Crypt::encrypt outside of Laravel

I'm creating a Laravel web app to sit along side a client's website. The website is older and wasn't...

0 Likes
2 Replies
Solved

Check if selected value exists in a database

I have a form, where user selects category from DB table "categories" and column "tit...

0 Likes
4 Replies

Creating a CMS-style Poll

I am working on creating a CRUD for polls to use during an event. Pretty easy concept - on a scale o...

0 Likes
1 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.

© 2025 Laravel.io - All rights reserved.