Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Findby Laravel Package

someonefamous/laravel-findby

Add dynamic finders to Eloquent models: call User::findByLastName('Smith') or User::findAllByFirstName('Bob') instead of where()->first()/get(). Works with any snake_cased field name via the FindBy trait.

View on GitHub
Deep Wiki
Context7

laravel-findby

Extended 'find' functionality for Eloquent (Laravel).

Enables writing queries like $that_smith_guy = User::findByLastName('Smith'), rather than the longer, but equivalent $that_smith_guy = User::where('last_name', 'Smith')->first().

Also, $all_the_bobs = User::findAllByFirstName('Bob') rather than $all_the_bobs = User::where('first_name', 'Bob')->get().

The command can be used for any arbitrary [snake-cased] field name. e.g. Item::findByArbitraryFieldName('example') is functionaly equivalent to Item::where('arbitrary_field_name', 'example')->first().

To use, simply add use SomeoneFamous\FindBy\Traits\FindBy; to any Eloquent model:

...

use SomeoneFamous\FindBy\Traits\FindBy;

class Thing extends Model
{
    use FindBy;

...
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor