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.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony