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

Extended Laravel Laravel Package

open-southeners/extended-laravel

Adds handy Laravel extensions and helper utilities to streamline common tasks and reduce boilerplate. Designed as a lightweight add-on for projects needing extra convenience features beyond the core framework, with simple installation and integration.

View on GitHub
Deep Wiki
Context7

description: List of functions that works for Laravel Eloquent models.

Helpers

This is the list of functions that you can import and use on your Laravel app through the static methods of the OpenSoutheners\ExtendedLaravel\Helpers class.

modelFrom

Gets model fully qualified class or instanced object from given string.

Helpers::modelFrom('post');
// 'App\Models\Post'

Helpers::modelFrom('post', false);
// object instance for App\Models\Post

Helpers::modelFrom('post', true, 'Domain\Posts');
// 'Domain\Posts\Post'

isModel

Checks if object or class is a Eloquent model.

Helpers::isModel(App\Models\Post::class);
// true

Helpers::isModel(new App\Models\Post());
// true

instanceFrom

Creates a model instance from given key (generally its ID or specified primary key).

Helpers::instanceFrom(1, App\Models\Post::class);
// object instance for App\Models\Post with ID 1

Helpers::instanceFrom(1, App\Models\Post::class, ['id', 'title']);
// object instance for App\Models\Post with ID 1 and only selecting id and title columns

Helpers::instanceFrom(1, App\Models\Post::class, ['*'], ['author']);
// object instance for App\Models\Post with ID 1 and with author relationship loaded

keyFrom

Tries to get Eloquent model key from given variable (can be of multiple types).

Helpers::keyFrom('1');
// 1

Helpers::keyFrom('80b6dc25-8773-4639-abcf-ed1f157deea1');
// '80b6dc25-8773-4639-abcf-ed1f157deea1'

Helpers::keyFrom(App\Models\Post::find(1));
// 1

queryFrom

Gets always a new Eloquent query builder instance from given model.

Helpers::queryFrom(App\Models\Post::class);
// object instance for \Illuminate\Database\Eloquent\Builder

Helpers::queryFrom(App\Models\Post::query()->where('title', 'hello'));
// new object instance for \Illuminate\Database\Eloquent\Builder

getCacheLockOwner

Get cache atomic locks owner or false otherwise if no lock found.

Cache::lock('podcasts.1.upload')->get();

Helpers::getCacheLockOwner('podcasts.1.upload');
// 432afra2pjna

Cache::lock('podcasts.2.upload')->get();

Helpers::getCacheLockOwner('podcasts.*');
// ['podcasts.1.upload', 'podcasts.2.upload']
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
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