larsmbergvall/utilities-for-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

larsmbergvall/utilities-for-laravel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require larsmbergvall/utilities-for-laravel

包简介

Some utilities and helpers for use in Laravel projects

README 文档

README

This is a collection of some utilities that I personally use when developing Laravel applications. Feel free to use them in your own projects!

Usage

You can publish the action stub with:

php artisan vendor:publish --tag=utilities-for-laravel-stubs

You can publish the config with:

php artisan vendor:publish --tag=utilities-for-laravel-config

What is included?

Make:action command

php artisan make:action CreatePost command that creates an action class * This would create a CreatePostAction.cs - if you don't want the suffix you can disable it in the config file (or change the suffix to something else)

Result class

A Result class inspired by Rusts Result type

        /** @var Result<array, string> $result */
//        $result = Result::ok(['value' => 'foo']);
        $result = Result::err('something went wrong');

        $result->match(
            ok: fn(array $data) => dd($data),
            err: fn(string $error) => dd($error)
        );

//        $data = $result->getValue();
        $error = $result->getErr();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-23