承接 setwise/laravel-helpers 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

setwise/laravel-helpers

Composer 安装命令:

composer require setwise/laravel-helpers

包简介

Setwise's generic package containing helpful Laravel tools

README 文档

README

Setwise's generic package containing helpful Laravel tools

Installation

Install via the command

composer require setwise/laravel-helpers  

Configuration

To publish this package's config file use the command

php artisan vendor:publish --tag=setwise-helpers-config

Usage

Commands

  • php artisan email:check-verified [email] [email2] [email...] Use this command to check if given email(s) are verified

  • php artisan email:verify-all Use this command to verify all emails in the database

  • php artisan email:unverify [email] [email2] [email...] Use this command to unverify given email(s)

  • php artisan email:verify [email] [email2] [email...] Use this command to verify given email(s)

  • php artisan db:initialize This command will initialize your active database connection with all the proper extensions and requirements for Setwise

  • php artisan setwise:logseed Use this command to insert testing log entries

Controller Traits

ControllerHasUploads

Desc: This trait adds two methods to any controller action, uploadFile() and deleteFile() to allow for easy file uploads and storage
Configuration: In your controller's __construct() function, define these parameters

// Prefix folder to prepend to your uploaded file
protected $uploadBucket = '';

// Class the file is being uploaded for, typically a model
protected $uploadClass = '';

// Authorize string resulting from a $this->can($uploadClass, $uploadAuthorize) to authorize the upload
protected $uploadAuthorize = '';

// Validation rules applied ot the upload
protected $uploadRules = 'required|file|image|max:2048';

And add these two routes to web.php

Route::post('<URL>', '<Controller>@uploadFile')->name('<Name>');
Route::post('<URL>', '<Controller>@deleteFile')->name('<Name>');          

Database Macros

Macro 1
Macro 2
Macro 3
Macro 4
Macro 5

Eloquent Traits

SoftDeletesRouteBinding

Desc: Soft deleted entries cannot be recovered when passed in the url for restoration by default, so this trait allows for the usage of route parameters even on restore routes with deleted models.
For this method to work, you MUST have restore within your route url

Helpers

  • humanize() Humanize takes in an underscore cased string and coverts it to a human readable sentence

Testing

composer test  

Changelog

Please see CHANGELOG for more information what has changed recently.

Credits

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固