edujugon/laravel-extra-features
Composer 安装命令:
composer require edujugon/laravel-extra-features
包简介
This package provides useful features to give extra functionality to your Laravel project
README 文档
README
This package provides useful features to give extra functionality to your Laravel project.
Installation
type in console:
composer require edujugon/laravel-extra-features
Laravel 5.*
Register the package service by adding it to the providers array.
IMPORTANT! Ensure you put that line at the end of the providers list.
'providers' => array(
...
Edujugon\LaravelExtraFeatures\Providers\LaravelExtraFeaturesServiceProvider::class
)
Publish the package's configuration file to the application's own config directory
php artisan vendor:publish --tag=ExtraFeaturesConfig
The above line will create a file called extrafeatures.php under config folder.
Feature List
Functionality
Traits
Services
Redirect No Page Found
When user tries to load an unknown url, it's redirected to a specific known url.
!IMPORTANT, This feature won't work for local environment. That's an intended behaviour no to hide any redirect/request error.
- Go to
config/extrafeatures.phpfile and update the value for the keyREDIRECT_NO_PAGE_FOUND.
Carbon Locale
Carbon language is set based on the laravel's app locale. By default it is enabled. You may disable changing CARBON_LOCALE value to falsein config/extrafeatures.php file.
DateScopesTrait
Provide extra features on year, month and day to retrieve data for Laravel Eloquent.
Adding $dateColumn as model class's property you don't need to pass the $dateColumn parameter to the methods.
/** * Get items of passed year * If no year, returns Items of current year * * @param $query * @param $column * @param null $year * @return mixed */ public function scopeYear($query,$dateColumn = null,$year = null)
/** * Get items of passed month * If no month, take current month * If no year, take current year * * @param $query * @param $column * @param null $month * @param null $year * @return mixed */ public function scopeMonth($query,$dateColumn = null,$month = null,$year = null)
/** * Get items of passed day. * If no day, take current day * If no month, take current month * If no year, take current year * * @param $query * @param $column * @param null $day * @param null $month * @param null $year * @return mixed */ public function scopeDay($query,$dateColumn = null,$day = null, $month = null, $year = null)
QueryCreator
Create DB query dynamically
/** * Create a query dynamically with passed parameters. * * Params: * tableName is the table name. * array is a list of data to be converted to query. * * @param $tableName * @param array $array * @return mixed */ static public function dynamic($tableName, array $array)
API list
Table
table method sets the table name for the Query.
Syntax
object table($tableName)
#####Build
build method builds the query based on passed array.
Syntax
object build(arrray $data)
Use Cases
$array = [ '<'=>['pvr'=>'pvl'], 'like'=>['id_imagen'=>'"%5047%"'], 'null'=>['margen_1'] ]; QueryCreator::dynamic('products',$array)->select('id','id_imagen')->first());
edujugon/laravel-extra-features 适用场景与选型建议
edujugon/laravel-extra-features 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 3, 最近一次更新时间为 2016 年 10 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「features」 「laravel」 「core」 「extra features」 「extra functionality」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 edujugon/laravel-extra-features 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 edujugon/laravel-extra-features 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 edujugon/laravel-extra-features 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Contao Open Source CMS
Adds some direct links and composer auto-fill capabilities.
Application helper classes and methods.
Provides basic functionality of a common application
DiZed Team Core module for the Magento 2 project
Provee funciones comunes de uso frecuente en proyectos PHP
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-18