Download the PHP package artflow-studio/snippets without Composer
On this page you can find all versions of the php package artflow-studio/snippets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download artflow-studio/snippets
More information about artflow-studio/snippets
Files in artflow-studio/snippets
Package snippets
Short Description A Laravel package for performing basic operations.
License MIT
Informations about the package snippets
🚀 AF Web Snippets
A powerful collection of Laravel web snippets to supercharge your development workflow
    📋 Table of Contents
- ✨ Features
- 🔧 Installation
- 🚀 Quick Start
- 📚 Components
- Dynamic Dropdown (AFDropdown)
- Unique ID Generator
- Data Formatters
- 🎨 Customization
- 🔍 Examples
- 🤝 Contributing
- 📄 License
- 👥 Authors
✨ Features
- 🎯 Dynamic Dropdown - Livewire-powered searchable dropdowns with real-time filtering
- 🆔 Unique ID Generator - Multiple ID generation strategies (6-digit & Base36)
- 📱 Data Formatters - Format Pakistani phone numbers and CNIC
- 📱 Responsive Design - Bootstrap-compatible components
- ⚡ Performance Optimized - Efficient database queries with debouncing
- 🛠️ Highly Customizable - Extensive configuration options
- 🔒 Secure - Built-in validation and error handling
🔧 Installation
Install the package via Composer:
Service Provider Registration
The package uses Laravel's auto-discovery feature. If you're using Laravel 5.5+, the service provider will be automatically registered.
Publish Assets (Optional)
🚀 Quick Start
Add the following line at the end of your <body>
tag in your Blade layout:
That's it! You're ready to use AF Web Snippets in your Laravel application.
📚 Components
🎯 Dynamic Dropdown (AFDropdown)
A powerful Livewire component for searchable dropdowns with real-time filtering, minimum search length, and elegant UI.
Basic Usage
Advanced Configuration
Listening to Selection Events
🔍 Distinct Select (AFDistinctSelect)
A specialized component for preventing spelling mistakes by showing existing values from the database. Perfect for fields like cities, countries, or categories where you want consistent data entry.
Basic Usage
Advanced Configuration
Handling Updates in Parent Component
AFDistinctSelect Features
- ✅ Spelling Prevention - Shows existing values to prevent duplicates
- ✅ Type-ahead Search - Real-time filtering of existing values
- ✅ Exact Value Selection - Updates input with exact database spelling
- ✅ Data Consistency - Ensures uniform data entry
- ✅ Bootstrap Compatible - Seamless integration with Bootstrap styling
- ✅ Customizable - Flexible configuration options
Configuration Options
Option | Type | Default | Description |
---|---|---|---|
model |
string | required | Eloquent model class |
column |
string | required | Database column to search and display |
value |
string | '' | Current field value |
wireModel |
string | column name | Livewire property to bind |
classes |
string | 'form-control' | CSS classes for input |
placeholder |
string | 'Select or type...' | Input placeholder text |
minSearchLength |
int | 1 | Minimum characters before search |
maxResults |
int | 10 | Maximum results to show |
AFDropdown Features
- ✅ Real-time Search - Debounced search with 300ms delay
- ✅ Minimum Search Length - Configurable minimum characters (default: 3)
- ✅ Loading States - Visual feedback during search
- ✅ Clear Button - Easy reset functionality
- ✅ Keyboard Navigation - Accessible dropdown interaction
- ✅ Bootstrap Compatible - Seamless integration with Bootstrap styling
AFDropdown Configuration Options
Option | Type | Default | Description |
---|---|---|---|
model |
string | required | Eloquent model class |
column |
string | required | Database column to search and display |
classes |
string | 'form-control' | CSS classes for input |
placeholder |
string | 'Search...' | Input placeholder text |
min-search-length |
int | 3 | Minimum characters before search |
🆔 Unique ID Generator
Generate unique identifiers for your models with multiple strategies and collision detection.
Basic Usage
Advanced Usage
ID Generation Methods
unique6digitID()
- Generates 6-digit numeric IDs (100000-999999)generateUniqueBase36ID()
- Generates Base36 IDs with timestamp encodinggenerateUniqueID($model, $column)
- Generates unique IDs with collision checking
📱 Data Formatters
Format common data types for Pakistani users with intelligent detection and formatting.
Pakistani Phone Number Formatter
Pakistani CNIC Formatter
Usage in Models
🎨 Customization
Styling AFDropdown
🔍 Examples
Dropdown with Event Handling
🛠️ Requirements
- PHP >= 8.0
- Laravel >= 9.0
- Livewire >= 3.0
- Bootstrap >= 5.0 (for styling)
🤝 Contributing
We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👥 Authors
- @RaHee554 - Initial work and maintenance
🙏 Acknowledgments
- Laravel community for the amazing framework
- Livewire team for the reactive components
- Bootstrap team for the UI framework
- All contributors who help improve this package
Made with ❤️ for the Laravel community