Skip to content

Useful Laravel support utilities.

License

Notifications You must be signed in to change notification settings

xcopy/laravel-support

Repository files navigation

Laravel Support

GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Laravel support utilities.

Installation

Note: This package is not yet available on Packagist. You must add it to your composer.json manually.

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/xcopy/laravel-support"
        }
    ],
    "require": {
        "xcopy/laravel-support": "dev-main"
    }
}

Features

Enum Traits

  • HasLabel - Generates human-readable labels from enum values
  • HasValues - Returns array of all enum values
  • HasChoices - Returns enum cases as value => label pairs for dropdowns
  • HasStaticCase - Magic static method access using camelCase only

Eloquent Casts

  • AsEmailString - Trims and lowercases email addresses
  • AsModelClass - Casts to model class name
  • AsTitledString - Converts to a title case
  • AsTrimmedString - Trims whitespace

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

About

Useful Laravel support utilities.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages