This package provides extended support for our spatie/enum package in Laravel.

Related tags

Laravel php laravel enum
Overview

Laravel support for spatie/enum

Latest Version on Packagist License Postcardware

PHP from Packagist Build Status Total Downloads

This package provides extended support for our spatie/enum package in Laravel.

Installation

You can install the package via composer:

composer require spatie/laravel-enum

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Usage

// a Laravel specific base class
use Spatie\Enum\Laravel\Enum;

/**
 * @method static self DRAFT()
 * @method static self PREVIEW()
 * @method static self PUBLISHED()
 * @method static self ARCHIVED()
 */
final class StatusEnum extends Enum {}

Model Attribute casting

Chances are that if you're working in a Laravel project, you'll want to use enums within your models. This package provides two custom casts and the \Spatie\Enum\Laravel\Enum also implements the \Illuminate\Contracts\Database\Eloquent\Castable interface.

use Illuminate\Database\Eloquent\Model;

class TestModel extends Model
{
    protected $casts = [
        'status' => StatusEnum::class,
        'nullable_enum' => StatusEnum::class.':nullable',
        'array_of_enums' => StatusEnum::class.':collection',
        'nullable_array_of_enums' => StatusEnum::class.':collection,nullable',
    ];
}

By using the casts the casted attribute will always be an instance of the given enum.

$model = new TestModel();
$model->status = StatusEnum::DRAFT();
$model->status->equals(StatusEnum::DRAFT());

Validation Rule

This package provides a validation rule to validate your request data against a given enumerable.

use Spatie\Enum\Laravel\Rules\EnumRule;

$rules = [
    'status' => new EnumRule(StatusEnum::class),
];

This rule validates that the value of status is any possible representation of the StatusEnum.

But you can also use the simple string validation rule definition:

$rules = [
    'status' => [
        'enum:'.StatusEnum::class,
    ],
];

If you want to customize the failed validation messages you can publish the translation file.

php artisan vendor:publish --provider="Spatie\Enum\Laravel\EnumServiceProvider" --tag="translation"

We pass several replacements to the translation key which you can use.

  • attribute - the name of the validated attribute
  • value - the actual value that's validated
  • enum - the full class name of the wanted enumerable
  • other - a comma separated list of all possible values - they are translated via the enums array in the translation file

Request Data Transformation

A common scenario is that you receive an enumerable value as part of your request data. To let you work with it as a real enum object you can transform request data to an enum in a similar way to the model attribute casting.

Request macro

There is a request macro available which is the base for the other possible ways to cast request data to an enumerable.

$request->transformEnums($enumCastRules);

This is an example definition of all possible request enum castings. There are three predefined keys available as constants on Spatie\Enum\Laravel\Http\EnumRequest to cast enums only in specific request data sets. All other keys will be treated as independent enum casts and are applied to the combined request data set.

use Spatie\Enum\Laravel\Http\EnumRequest;

$enums = [
    // cast the status key independent of it's data set
    'status' => StatusEnum::class,
    // cast the status only in the request query params
    EnumRequest::REQUEST_QUERY => [
        'status' => StatusEnum::class,
    ],
    // cast the status only in the request post data
    EnumRequest::REQUEST_REQUEST => [
        'status' => StatusEnum::class,
    ],
    // cast the status only in the request route params
    EnumRequest::REQUEST_ROUTE => [
        'status' => StatusEnum::class,
    ],
];

You can call this macro yourself in every part of your code with access to a request instance. Most commonly you will do this in your controller action if you don't want to use one of the other two ways.

Form Requests

Form requests are the easiest way to cast the data to an enum.

use Illuminate\Foundation\Http\FormRequest;
use Spatie\Enum\Laravel\Http\Requests\TransformsEnums;
use Spatie\Enum\Laravel\Rules\EnumRule;

class StatusFormRequest extends FormRequest
{
    use TransformsEnums;

    public function rules(): array
    {
        return [
            'status' => new EnumRule(StatusEnum::class),
        ];
    }

    public function enums(): array
    {
        return [
            'status' => StatusEnum::class,
        ];
    }
}

The request data transformation is done after validation via the FormRequest::passedValidation() method. If you define your own passedValidation() method you have to call the request macro transformEnums() yourself.

protected function passedValidation()
{
    $this->transformEnums($this->enums());

    // ...
}

Route Binding

Beside using form requests, you can also use route binding. Similar Laravel's Route Model Binding, it automatically inject enum instances into your route action.

Implicit Binding

To use implicit route binding, be sure add Spatie\Enum\Laravel\Http\Middleware\SubstituteBindings middleware. For example, add it in your app\Http\Kernel.php:

protected $middlewareGroups = [
    'web' => [
        // ...
        \Spatie\Enum\Laravel\Http\Middleware\SubstituteEnumBindings::class,
    ],
];

Use a type-hinted variable name that matches route segment to use implicit route binding.

Route::get('/posts/{status}', function (StatusEnum $status) {
    return $status;
});

Explicit Binding

To have an explicit binding, there is a Route::enum() macro. It's important that your route/group uses the \Illuminate\Routing\Middleware\SubstituteBindings middleware. This middleware is enabled by default for the web route group.

Route::enum('status', StatusEnum::class);
Route::get('/posts/{status}', function (Request $request) {
    return $request->route('status');
});

Enum Make Command

We provide an artisan make command which allows you to quickly create new enumerables.

php artisan make:enum StatusEnum

You can use --method option to predefine some enum values - you can use them several times.

Faker Provider

It's very likely that you will have a model with an enum attribute and you want to generate random enum values in your model factory. Because doing so with default faker is a lot of copy'n'paste we've got you covered with a faker provider Spatie\Enum\Laravel\Faker\FakerEnumProvider. The static register() method is only a little helper - you can for sure register the provider the default way $faker->addProvider(new FakerEnumProvider).

The faker methods itself are inherited from the base packages Faker Provider.

Testing

composer test
composer test-coverage

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

Comments
  • BadMethodCallException with numerical enum values

    BadMethodCallException with numerical enum values

    I have a UserTypeEnum with 2 values, Provider and Client. I had already created the database schema with tiny integers for this field so I wanted to set the values to be numerical.

    I could not see an example in the documentation for this package but I saw an example of using numbers in the base enum package.

    My class is below. When I call the request transformation function, it throws a BadMethodCallException which I think is because of the strict comparison between values. My form is a simple POST form which is submitting a string "1" which does not match the numerical 1 in the values array.

    The error is as follows:

    BadMethodCallException There's no value 1 defined for enum App\Enums\UserTypeEnum, consider adding it in the docblock definition.

    Enum example:

    /**
     * @method static self PROVIDER()
     * @method static self CLIENT()
     */
    final class UserTypeEnum extends Enum
    {
        protected static function values(): array
        {
            return [
                'PROVIDER' => 1,
                'CLIENT' => 2,
            ];
        }
    }
    

    This is how I am calling the transformEnums method.

    $request->transformEnums($this->enumCastRules());
    

    Below is the enum cast rules I am using.

    private function enumCastRules()
    {
        return [
            'type' => UserTypeEnum::class,
        ];
    }
    

    My form field:

    <input type="radio" name="type" id="type_provider" value="{{ \App\Enums\UserTypeEnum::PROVIDER() }}">
    
    bug enhancement help wanted hacktoberfest 
    opened by djam90 23
  • request transform

    request transform

    This is my first idea how to implement a request transformer via FormRequest, Request macro and Middleware. It's untested but should give a good idea of how it's done and could be used.

    • FormRequest auto transforms during resolvance - after validation
    • Middleware have to used via new TransformEnums([...]) but can transform everything, including route params
    • Request::transformEnums() is the base implementation which is used by all others

    Some code and ideas are from https://github.com/konsulting/laravel-transformer

    opened by Gummibeer 16
  • Implicit & Explicit Route Bindings

    Implicit & Explicit Route Bindings

    Problems with TransformEnums

    First, I know there is already a TransformEnums middleware available. The original PR (#7) gives following route example:

    Route::get('post/{status}', 'xyz@abc')
        ->middleware(new TransformEnums([ 'status' => StatusEnum::class ]));
    

    This example doesn't work, because inside Laravel, MiddlewareNameResolver only accept either a string or a Closure. In this example, it's a Middleware instance. (see source code) If it accept Closure, then we got a workaround:

    Route::get('post/{status}', 'xyz@abc')
        ->middleware(static fn ($request, $next) => (new TransformEnums([ 'status' => StatusEnum::class ]))->handle($request, $next));
    

    There comes another problem in this middleware approach, that we can't type hinting on the method signature, because service container will try to resolve it.

    // Illuminate\Contracts\Container\BindingResolutionException
    //   Unresolvable dependency resolving [Parameter #0 [ <required> $value ]] in class Spatie\Enum\Enum
    Route::get('post/{status}', fn (StatusEnum $status) => var_dump($status))
        ->middleware(static fn ($request, $next) => (new TransformEnums([ 'status' => StatusEnum::class ]))->handle($request, $next));
    

    It would be awesome if we can just type hinting on controller method and get it automatically convert to a Spatie\Enum\Enum instance.

    ImplicitRouteBinding

    Laravel already does a similar thing to Models, which is so called implicit route binding. Under the hood, implicit route binding looks for type hinting. If the parameter type is a sub class of UrlRoutable, it calls resolveRouteBinding on it to get a model instance. The first thought I got is to make Enum implements UrlRoutable, it works but also breaks some thing. If you look at Illuminate/Routing/ImplicitRouteBinding, it will first call service container to make an instance of the model, then call the resolveRouteBiding on the created model instance. If we want to make Enum use the same UrlRoutable, then it must be instancable without given a value.

    Here I got another idea, is to make our own middleware use the similar way to resolve Enum instances, but instead looking for UrlRoutable, we just looking for Enum. This PR is a PoC.

    Example usage

    // app/Http/Kernel.php
    
    protected $middlewareGroups = [
      'web' => [
        // ...
        \Spatie\Enum\Laravel\Http\Middleware\SubstituteBindings::class,
      ],
    ]
    
    // routes/web.php
    
    Route::get('post/{status}', fn (StatusEnum $status) => var_export($status) );
    

    Todo

    • [x] Tests
    • [ ] Better naming on classes, methods.
    • [x] Documentation.
    • [x] Explicit bindings.
    opened by binotaliu 7
  • Does laravel-enum v2 require laravel-framework v8?

    Does laravel-enum v2 require laravel-framework v8?

    I am trying to install spatie/laravel-enum 2.1 in my project running laravel-framework 7.19.1. (full error below) composer require spatie/laravel-enum --update-with-dependencies

    My guess is that spatie/laravel-enum requires illuminate/http ^8.0 and that is only available in Laravel 8? If so, does that mean that laravel-enum v2 is only compatible with laravel-framework v8?

      Problem 1
        - Installation request for spatie/laravel-enum ^2.1 -> satisfiable by spatie/laravel-enum[2.1.0].
        - Conclusion: remove laravel/framework v7.19.1
        - Conclusion: don't install laravel/framework v7.19.1
        - spatie/laravel-enum 2.1.0 requires illuminate/http ^8.0 -> satisfiable by illuminate/http[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.10.0, v8.11.0, v8.11.1, v8.11.2, v8.12.0, v8.12.1, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0, v8.9.0].
        - don't install illuminate/http 8.x-dev|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.0.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.0.1|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.0.2|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.0.3|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.0.4|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.1.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.10.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.11.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.11.1|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.11.2|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.12.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.12.1|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.2.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.3.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.4.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.5.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.6.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.7.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.7.1|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.8.0|don't install laravel/framework v7.19.1
        - don't install illuminate/http v8.9.0|don't install laravel/framework v7.19.1
        - Installation request for laravel/framework (locked at v7.19.1, required as ^7.0) -> satisfiable by laravel/framework[v7.19.1].
    
    question 
    opened by kevindb 7
  • Nullable not working as expected

    Nullable not working as expected

    The nullable cast gets validated as being an actual string value when using:

    protected $casts = [
       'status' => SomeStatusEnum::class.':nullable'
    ];
    

    Exception: (spatie\Enum class) [expects a $value, "nullable" gets passed] There's no value "nullable" defined for enum SomeStatusEnum, consider adding it in the docblock definition.

    Removing the :nullable cast, also returns the exception that it's not passing (the expected number of) parameters ( see also spatie/enum#70 )

    When I change it to eg. SomeStatusEnum::class.:collection,nullable the above occurs with constructor $value "collection"

    question 
    opened by xewl 6
  • Hability to blacklist static methods

    Hability to blacklist static methods

    I know this issue has been discussed in spatie/enum#28 but with the recent addition of the Castable interface in Laravel I believe this needs to be revised.

    I've created custom casters to Enum classes and would like to be able to make them implement the Castable interface which required a public static castUsing() method.

    Currently this is impossible with Enum classes because static methods are assumed to be enum values. An @ignoreEnum doc annotation, like suggested in the issue, would solve this while still maintaining backwards compatibility.

    question 
    opened by gjm 6
  • Nullable Enums

    Nullable Enums

    Hi,

    This PR provides a solution for nullable enums as discussed in this issue #24

    There is no breaking changes, I hope it fits your standards !

    Regards

    opened by gaelreyrol 6
  • use Laravel Enum in combination with database migration (and: how to list possible values)

    use Laravel Enum in combination with database migration (and: how to list possible values)

    Two part question:

    1. is it possible to create a collection of possible values for an enum? I see the Model $casts, but how would I achieve it outside a Model, e.g. in tinker?
    2. how do I use Laravel Enum in combination with a database migration?

    This to avoid hardcoding e.g.

                $table->enum('status', ['draft','approved','archived']);
    

    Could be I am misunderstanding the package, in which case: apologies!

    question 
    opened by wivaku 5
  • Route binding

    Route binding

    follow up to #62

    the drop of TransformEnums middleware isn't breaking in this case as the middleware is/was unusable the current way - described by @binotaliu in #62 . @brendt do you think the same? Or should I keep it in the package and just flag it as @deprecated - just in case?

    enhancement 
    opened by Gummibeer 5
  • Unexpected validation exception in Livewire

    Unexpected validation exception in Livewire

    I'm trying to implement this package in a Livewire component. Some code to illustrate:

    Our Enum:

    /**
     * @method static self BUSINESS()
     * @method static self HOUSEHOLD()
     */
    final class CustomerType extends Enum
    {
        protected static function values(): array
        {
            return [
                'BUSINESS' => 'business',
                'HOUSEHOLD' => 'household',
            ];
        }
    }
    

    Our Model:

    class Customer extends Model
    {
    ...
        protected $casts = [
            'type' => CustomerType::class,
        ];
    ...
    

    Our Livewire component:

    class CustomerEdit extends Component
    {
    ...
        public $customer;
    
        protected function rules()
        {
            return [
                'customer.type' => 'enum:'.CustomerType::class,
    
    ...
    

    I manipulate customer.type with a radio button. When I @json this on the rendered page, I get the type as a string. But as soon as I validate it, I get (thanks Ray!):

    TypeError {#1745 ▼
      #message: "Only string and integer are allowed values for enum Domain\Customers\Enums\CustomerType."
      #code: 0
      #file: "my_app/vendor/spatie/enum/src/Enum.php"
      #line: 87
      trace: {▶}
    }
    

    This is coming from passes(..) in the EnumRule. It sets the value with:

    $this->asEnum($value);
    

    But $value appears to be the CustomerType enum. It's not a string or integer. That's why it fails. I'm not sure why this happens. Should this be fixed in this package or are we doing something wrong?

    enhancement help wanted good first issue question 
    opened by ju5t 5
  • Creating New Model - No Value Defined for Enum

    Creating New Model - No Value Defined for Enum

    I have :

    • Package model with package_type attribute
    • PackageTypeEnum class

    I already cast the package_type attribute with PackageTypeEnum class, it's working properly as expected, but I got an issue while creating new model, unable to assign value directly. In my views, I loaded the values and labels of PackageTypeEnum using toArray() static method then make them as select option field. When I try to create new Package it respond an error for package_type field

    • views
    <select name="package_type" id="__package_typeAddPackage">
        <option value="" selected disabled>
            {{ __('Select Type') }}
        </option>
        @foreach ($packageTypes as $value => $label)
            <option value="{{ $value }}">
                {{ $label }}
            </option>
        @endforeach
    </select>
    
    • store method
    ...
        public function store(StoreRequest $request)
        {
                $data = $request->validated();
    
                $package = new Package();
                $package->package_type = $data['package_type'];
    ...
    
    • the errors
    There's no value 2 defined for enum App\Enums\PackageTypeEnum, ...
    

    What's the best practice and/or How to deal with this case, when we want to directly assign the value to our Enum cast attributes? Do I have to create new method that returns every single value of my enum static method?

    Thanks

    opened by ibnuhalimm 4
  • EnumRule issue with different Enums, same value

    EnumRule issue with different Enums, same value

    Hi, When we have 2 different enums and 1 rule EnumRule(EmailScopeEnum::class

    /**
    @method static self DEFAULT()
    **/
    EmailScopeEnum {
    }
    
    /**
    @method static self DEFAULT()
    **/
    PhoneScopeEnum {
    }
    

    When we try to check rule against PhoneScopeEnum::DEFAULT() it's working, because DEFAULT can be resolved also in EmailScopeEnum

    I fix this by changing passes function in EnumRule

    public function passes($attribute, $value): bool
        {
            $this->attribute = $attribute;
            $this->value = $value;
    
            if ($value instanceof $this->enum) {
                return true;
            }
    
            if ($value instanceof Enum && !$value instanceof $this->enum) {
                return false;
            }
    
            try {
                $this->asEnum($value);
    
                return true;
            } catch (Throwable $ex) {
                return false;
            }
        }
    
    enhancement 
    opened by abrampl 0
  • Form request validated data is not casted to enum

    Form request validated data is not casted to enum

    Hello :wave:,

    When casting enums in a Form Request, only the data payload in the Request instance is getting cast. So if following best practice and getting the data with the validated method in a controller, the original pre-cast data will be returned.

    class Controller
    {
        public function index(MyFormRequest $request)
        {  
            $request->validated()); // Doesn't return cast data
    
            $request->get('status'); // Return cast data
        }
    }
    

    As a fix, I created an enhanced TransformsEnums trait implementing the following method:

    public function withValidator(Validator $validator)
    {
        $validator->after(function (Validator $validator) {
            $data = $validator->getData();
    
            /** @var Enum $enumClass */
            foreach ($this->enums() as $key => $enumClass) {
                Arr::set($data, $key, $enumClass::from($this[$key]));
            }
    
            $validator->setData($data);
        });
    }
    

    Do you think that this is something that could be added to the package?

    I could draft a PR on this, but given the native enum support on PHP 8.1 I wanted to make sure you would continue the maintenance of laravel-enum before working on it.

    Cheers.

    enhancement question 
    opened by nicolasbeauvais 3
Releases(3.0.1)
Owner
Spatie
We create open source, digital products and courses for the developer community
Spatie
Implementation Package Spatie/Laravel-Permission

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

M Rizal 3 Sep 12, 2021
An extended laravel eloquent WHERE method to work with sql LIKE operator.

Laravel Eloquent WhereLike An extended laravel eloquent WHERE method to work with sql LIKE operator. Inspiration The idea of this package comes from o

Touhidur Rahman 33 Aug 6, 2022
A collection of classes to be extended/used in laravel apps for quick development

laraquick A collection of classes to be extended/used in laravel applications for quick development. Introduction The library contains traits with wel

Ezra Obiwale 35 Dec 13, 2022
Scout Extended: The Full Power of Algolia in Laravel

Documentation • Community Forum • Stack Overflow • Report a bug • FAQ • Support To dig right in, visit the Scout Extended documentation. Scout Extende

Algolia 378 Dec 1, 2022
Laravel Nova filter for Spatie/laravel-tags

SpatieTagsNovaFilter This package allows you to filter resources by tags. (using the awesome Spatie/laravel-tags and Vue-MultiSelect ) Installation Fi

Mahi-Mahi 3 Aug 4, 2022
A Laravel wrapper for spatie/dns. Allows to query and validate DNS records.

A Laravel wrapper for spatie/dns. Allows to query and validate DNS records.

Astrotomic 22 Nov 17, 2022
Forked from spatie-laravel-tags

Add tags and taggable behaviour to a Laravel app This package offers taggable behaviour for your models. After the package is installed the only thing

null 1 Nov 15, 2021
A quiz application with laravel 8, spatie permissions, livewire, jetstream, chartjs, tailwindcss and more!

Todo Currently busy with some other important things, will definately would like to imporove the app with 1. Multiple choices selection and mapping to

Baig 67 Nov 21, 2022
Filament-spatie-laravel-activitylog - View your activity logs inside of Filament. ⚡️

View your activity logs inside of Filament. This package provides a Filament resource that shows you all of the activity logs created using the spatie

Ryan Chandler 45 Dec 26, 2022
.env vars check for Spatie's Laravel Health

Custom check for Spatie's Laravel Health - Ensure every .env variable you need has a value

Encodia 4 Nov 7, 2022
Proyecto Start-Basic sobre Login y crud de usuarios, mediante Api Rest, usando la plantilla AdminLte 3.1 y manejo de roles y permisos con spatie y autenticacion JWT

Proyecto Start-Basic sobre Login y crud de usuarios, mediante Api Rest, usando la plantilla AdminLte 3.1 y manejo de roles y permisos con spatie y autenticacion JWT

null 9 Jul 5, 2022
Laravel 5 Repositories is used to abstract the data layer, making our application more flexible to maintain.

Laravel 5 Repositories is used to abstract the data layer, making our application more flexible to maintain.

Anderson Andrade 4k Jan 6, 2023
An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality.

Support An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality. Ins

Ian Olson 3 Apr 14, 2021
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Ollie Codes 19 Jul 5, 2021
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

null 9 Dec 14, 2022
Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

Laravel Uuid Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for versio

Christoph Kempen 1.7k Dec 28, 2022
View themes is a simple package to provide themed view support to Laravel.

Laravel View Themes View themes is a simple package to provide themed view support to Laravel. Installation Add alexwhitman/view-themes to the require

Alex Whitman 15 Nov 29, 2022
Laravel Philips Hue package to control your lights with remote support

Laravel Philips Hue ?? Introduction I created this package for my company Ploi (https://ploi.io) to control our office lights. For example, when we re

Dennis Smink 81 Aug 11, 2022
Package with small support traits and classes for the Laravel Eloquent models

Contains a set of traits for the eloquent model. In future can contain more set of classes/traits for the eloquent database.

Martin Kluska 3 Feb 10, 2022