ktourvas/laravel-extensions 问题修复 & 功能扩展

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

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

ktourvas/laravel-extensions

Composer 安装命令:

composer create-project ktourvas/laravel-extensions

包简介

collection of laravel based functionality extending classes

README 文档

README

Simple addon functionality classes for laravel.

Installation

require package in your laravel installation with

composer require ktourvas/laravel-extensions

after installation the package will automatically be discovered through laravel's auto-discovery feature.

follow the above with

php artisan vendor:publish 

in order for the package's configuration file to be published.

Usage

Middleware

I like to register extra middleware through the ServiceProviders of project packages and not globally and that is because I usually work with different packages in one local installation that require different functionality each and I usually don't want them to interfere with eachother. So in that case a middleware would be registered through the register() method of a Service Provider like below

public function register() 
{
    $this->app['router']->aliasMiddleware('IpRestrict', Laravel\extensions\Http\Middleware\ipRestrict::class);
}

ipRestrict

the ip restriction middleware checks a request's ip address against an array of whitelisted addresses set through configuration. The array is populated from the .env variable LE_WHITELIST. Values are separated with commas.

ex.

LE_WHITELIST=99.99.99.99,88.88.88.88,77.77.77.77

in the event of a non whitelisted address the request is aborted with a 404 response.

setLocale

the set locale middleware will check for the first segment on every request's url. If the first segment corresponds to a locale set through configuration, the application locale is set to that. Again in this case locale's are set through the .env variable LE_LOCALES

ex.

LE_LOCALES=en;el

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固