定制 pixielity/laravel-support 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pixielity/laravel-support

最新稳定版本:v1.0.0

Composer 安装命令:

composer require pixielity/laravel-support

包简介

Support utilities and helpers for Pixielity packages

README 文档

README

Support

The Pixielity Rain Support contains common classes relevant to supporting the other Pixielity Rain libraries. It adds the following features:

Scaffolding

See the Scaffolding Commands section of the Console documentation.

A true Singleton trait

A true singleton is a class that can ever only have a single instance, no matter what. Use it in your classes like this:

class MyClass
{
    use \Pixielity\Support\Traits\Singleton;
}

$class = MyClass::instance();

Global helpers

input()

Similar to Input::get() this returns an input parameter or the default value. However it supports HTML Array names. Booleans are also converted from strings.

$value = input('value', 'not found');
$name = input('contact[name]');
$city = input('contact[location][city]');

Event emitter

Adds event related features to any class.

Attach to a class

class MyClass
{
    use Pixielity\Support\Traits\Emitter;
}

Bind to an event

$myObject = new MyClass;
$myObject->bindEvent('cook.bacon', function(){
    echo 'Bacon is ready';
});

Trigger an event

// Outputs: Bacon is ready
$myObject->fireEvent('cook.bacon');

Bind to an event only once

$myObject = new MyClass;
$myObject->bindEvent('cook.soup', function(){
    echo 'Soup is ready. Want more? NO SOUP FOR YOU!';
}, true);

Bind an event to other object method

$myObject->bindEvent('cook.eggs', [$anotherObject, 'methodToCookEggs']);

Unbind an event

$myObject->unbindEvent('cook.bacon');
$myObject->unbindEvent(['cook.bacon', 'cook.eggs']);

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 22
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固