mindtwo/laravel-platform-manager

A pacakage to resolve platforms.

2.6.4 2024-03-13 08:51 UTC

README

Latest Version on Packagist Software License Total Downloads

Installation

You can install the package via composer:

composer require mindtwo/laravel-platform-manager

How to use?

Publish config

To publish the modules config file simply run

php artisan vendor:publish --provider="mindtwo\LaravelPlatformManager\Providers\LaravelPlatformManagerProvider" --tag=config

This publishes the platform-resolver.php config file to your projects config folder. Inside the config you can specify your Platform model which will be used by the package.

Publish migrations

To publish the modules migrations file simply run

php artisan vendor:publish --provider="mindtwo\LaravelPlatformManager\Providers\LaravelPlatformManagerProvider" --tag=migrations```

After publishing run

php artisan migrate

With Laravel Sanctum

To use the platforms with Laravel's Sanctum package you should add the middleware mindtwo\LaravelPlatformManager\Middleware\StatefulPlatformDomais to your project's Kernel.php. To be concrete to the middlewareGroup api or your equivalent. This middleware adds the plaform's hostnames to Sanctums Stateful Domains.

Retrieve a platform

To receive the current platform you are working in simply inject mindtwo\LaravelPlatformManager\Services\PlatformResolver to your service, controller, middleware, etc. Via the method getCurrentPlatform() you can receive your platform model.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@mindtwo.de instead of using the issue tracker.

Credits

License

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