Download the PHP package salehye/settings without Composer
On this page you can find all versions of the php package salehye/settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package settings
Salehye Settings Package
A lightweight, flexible Laravel settings package with InertiaJS & Blade support, multilingual capabilities, and database-driven configuration.
โจ Features
- ๐๏ธ Database-Driven - Store settings in database with
is_publicflag - ๐ Multilingual - Support for translated labels and content
- โก Caching - Built-in caching for optimal performance
- ๐จ InertiaJS Ready - Auto-share public settings with frontend
- ๐ง Flexible - Works with or without predefined definitions
- ๐งช Tested - Comprehensive Pest PHP test suite
- ๐ฆ SOLID - Clean architecture following Laravel best practices
๐ฆ Installation
1. Require the package
2. Publish assets
3. Run migrations
4. Register Middleware (Optional)
Add the middleware to share settings with Inertia automatically:
Laravel 11.x/12.x (bootstrap/app.php):
๐ Usage Methods
Method 1: Helper Functions (Recommended) โญ
Method 2: Facade
Method 3: Magic Methods
Method 4: HasSettings Trait (In Controllers)
Method 5: Dependency Injection
๐จ Blade Templates Integration
View Composer (Automatic)
Public settings are automatically shared with all Blade views:
Blade Directives
Blade Component
Publish Component Views
Then customize in resources/views/vendor/settings/components/setting.blade.php
๐ Database Schema
๐ฏ Creating Settings
Method 1: Direct Database (Recommended)
Method 2: With Config Definitions
Add to config/settings.php:
๐ InertiaJS Integration
Auto-Share Public Settings
After registering ShareSettingsMiddleware, all public settings are automatically shared:
Settings Controller
The package provides a controller for settings management:
Inertia Frontend Example (Vue 3)
๐ง Configuration
Cache Settings
Inertia Settings
๐งโโ๏ธ Advanced Usage
Type Casting
The package automatically handles type casting based on config definitions:
Custom Repository
Clear Cache
๐งช Testing
๐ Example: Complete Setup
1. Create Settings Seeder
2. Run Seeder
3. Use in Application
๐ฆ Package Structure
๐งช Testing
๐ค Contributing
Contributions are welcome! Please see our Contributing Guide for details.
Quick Guide
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Create a Pull Request
Requirements
- Follow PSR-12 coding standards
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass
๐ License
This package is open-sourced software licensed under the MIT License.
๐ Roadmap
- [ ] Add settings import/export functionality
- [ ] Add settings versioning
- [ ] Add real-time settings sync
- [ ] Add settings presets
- [ ] Add multi-environment support
๐ Support
If you find this package helpful, please consider giving it a โญ๏ธ on GitHub!
Support the Development
- GitHub Sponsors
- Buy Me a Coffee
- PayPal
Built with โค๏ธ for the Laravel Community
๐ Contact
- Email: [email protected]
- GitHub: @salehye
- Twitter: @salehye