rappasoft/laravel-helpers
最新稳定版本:v3.0.1
Composer 安装命令:
composer require rappasoft/laravel-helpers
包简介
Laravel Helpers for Non-Laravel Projects
README 文档
README
Laravel Helpers for Non-Laravel Projects
This project takes the useful Laravel helper functions and allows you to use them in Non-Laravel projects. Updated for compatibility with Laravel 10, 11, and 12.
Enjoying this package? Buy me a beer 🍺
Requirements
- PHP 8.1 or higher
- Composer
Installation
composer require rappasoft/laravel-helpers
Quick Start
Once installed, all helper functions are automatically available:
<?php require 'vendor/autoload.php'; // String helpers $slug = str_slug('Hello World'); // "hello-world" $plural = str_plural('user', 2); // "users" $masked = str_mask('1234567890', '*', 3, 4); // "123****890" // Array helpers $value = array_get($data, 'user.profile.name', 'Default'); $hasKey = array_has($data, 'user.email'); $first = array_key_first($array); // General helpers if (blank($value)) { // Handle empty value } $result = transform($value, function ($v) { return strtoupper($v); }, 'default');
Documentation and Usage Instructions
See the documentation for detailed installation and usage instructions.
Testing
This package includes comprehensive tests using PHPUnit. To run the tests:
# Install dependencies composer install # Run all tests vendor/bin/phpunit # Run specific test suite vendor/bin/phpunit tests/HelpersTest.php vendor/bin/phpunit tests/StringsTest.php vendor/bin/phpunit tests/ArraysTest.php
See tests/README.md for more testing information.
License
Since the Laravel framework is open-sourced software licensed under the MIT license, this project is licensed under the same license.
统计信息
- 总下载量: 623.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 282
- 点击次数: 1
- 依赖项目数: 29
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-04