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.
Installation Add the package via Composer:
composer require open-southeners/extended-laravel
Publish the config (if available) with:
php artisan vendor:publish --provider="OpenSoutheners\ExtendedLaravel\ExtendedLaravelServiceProvider"
First Use Case
Check the helpers.php file (likely located in vendor/open-southeners/extended-laravel/src/helpers.php) for utility functions. Example:
use OpenSoutheners\ExtendedLaravel\Helpers;
// Use a helper like `Helpers::slugify('My Test String')`
$slug = Helpers::slugify('My Test String'); // Returns 'my-test-string'
Service Provider & Facade
Register the package in config/app.php under providers:
OpenSoutheners\ExtendedLaravel\ExtendedLaravelServiceProvider::class,
Use the facade (if provided) in your code:
use OpenSoutheners\ExtendedLaravel\Facades\ExtendedLaravel;
$result = ExtendedLaravel::someHelperMethod();
String Manipulation Extend Laravel’s default string helpers with additional methods:
// Example: Convert camelCase to snake_case
$snakeCase = Helpers::camelToSnake('camelCaseString');
Collection Enhancements Add custom collection methods (if the package includes them):
$collection = collect([1, 2, 3]);
$doubled = $collection->extendedDouble(); // Hypothetical method
Request/Response Helpers Simplify request handling or response formatting:
// Example: Auto-format JSON responses
return ExtendedLaravel::formatResponse($data, 200);
Model & Eloquent Extensions Attach scopes or accessors to Eloquent models:
// Hypothetical: Add a 'published' scope
$posts = Post::published()->get();
Blade Directives Register custom Blade directives for reusable templates:
// Example: Add a 'json' directive to dump JSON
@json($variable)
Service Container Binding Bind custom classes to the container for dependency injection:
$this->app->bind('custom.helper', function () {
return new CustomHelper();
});
Middleware Extensions Use the package to simplify middleware logic:
public function handle($request, Closure $next) {
if (ExtendedLaravel::isAdmin($request)) {
return $next($request);
}
return response('Unauthorized', 403);
}
Event Listeners Leverage package helpers in event listeners for cleaner code:
public function handle(UserRegistered $event) {
$event->user->email_verified_at = now();
ExtendedLaravel::sendWelcomeEmail($event->user);
}
Namespace Conflicts Ensure helper functions don’t clash with existing Laravel or third-party helpers. Prefix custom methods if needed:
Helpers::extendedSlugify() // Instead of just slugify()
Configuration Overrides
If the package publishes config, ensure your .env or config/extended-laravel.php doesn’t conflict with defaults.
Facade vs. Helper Functions Avoid mixing facades and static helpers inconsistently. Stick to one style per project for maintainability.
Performance Overhead Some helper functions (e.g., regex-based transformations) may add minor overhead. Benchmark critical paths.
Undocumented Features
Since the package is new (2026), some features may lack documentation. Check the README or source code for undocumented methods.
Log Helper Outputs Use Laravel’s logging to debug helper behavior:
\Log::debug('Helper output:', ['result' => Helpers::someMethod($input)]);
Check for Deprecations If the package is actively maintained, monitor for breaking changes in minor updates.
Override Defaults Extend or override package behavior via service provider bindings:
$this->app->singleton('helpers', function () {
return new CustomHelpers();
});
Custom Helpers Add your own helpers by extending the package’s base class or creating a wrapper:
class AppHelpers extends \OpenSoutheners\ExtendedLaravel\Helpers {
public static function customMethod() { ... }
}
Macroable Extensions If the package supports macros (e.g., for collections), extend them:
\Illuminate\Support\Collection::macro('customMethod', function () {
return $this->map(...);
});
Package Configuration Modify published config to disable/enable features:
'features' => [
'string_helpers' => true,
'collection_macros' => false,
],
Testing Write unit tests for custom helpers to ensure reliability:
public function testSlugify() {
$this->assertEquals('test-string', Helpers::slugify('Test String'));
}
How can I help you explore Laravel packages today?