当前位置: 首页 > 软件库 > Web应用开发 > Web框架 >

laravel-packager

A cli tool for creating Laravel packages
授权协议 View license
开发语言 PHP
所属分类 Web应用开发、 Web框架
软件类型 开源软件
地区 不详
投 递 者 昌乐生
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Laravel Packager

This package provides you with a simple tool to set up a new package and it will let you focus on the development of the package instead of the boilerplate. If you like a visual explanation check out this video by Jeffrey Way on Laracasts.

Installation

Via Composer

$ composer require jeroen-g/laravel-packager --dev

If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:

JeroenG\Packager\PackagerServiceProvider::class,

If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider.Be aware that the auto-discovery also means that this package is loaded in your production environment. Therefore you may disable auto-discovery and instead put in your AppServiceProvider something like this:

if ($this->app->environment('local')) {
    $this->app->register('JeroenG\Packager\PackagerServiceProvider');
}

Optional you can publish the configuration to provide a different service provider stub. The default is here.

$ php artisan vendor:publish --provider="JeroenG\Packager\PackagerServiceProvider"

Available commands

New

Command:

$ php artisan packager:new my-vendor my-package

Result:The command will handle practically everything for you. It will create a packages directory, creates the vendor and package directory in it, pulls in a skeleton package, sets up composer.json and creates a service provider.

Options:

$ php artisan packager:new my-vendor my-package --i
$ php artisan packager:new --i

The package will be created interactively, allowing to configure everything in the package's composer.json, such as the license and package description.

$ php artisan packager:new my-vendor/my-package

Alternatively you may also define your vendor and name with a forward slash instead of a space.

Remarks:The new package will be based on this custom skeleton. If you want to use a different package skeleton, you can either:

  • (A) publish the configuration file and change the default skeleton that will be used by all packager:new calls.
  • (B) use the flag --skeleton="http://github.com/path/to/archive/master.zip" with your own skeleton to use the given skeleton for this one run instead of the one in the configuration.

Get & Git

Command:

$ php artisan packager:get https://github.com/author/repository
$ php artisan packager:git https://github.com/author/repository

Result:This will register the package in the app's composer.json file.If the packager:git command is used, the entire Git repository is cloned. If packager:get is used, the package will be downloaded, without a repository. This also works with Bitbucket repositories, but you have to provide the flag --host=bitbucket for the packager:get command.

Options:

$ php artisan packager:get https://github.com/author/repository --branch=develop
$ php artisan packager:get https://github.com/author/repository my-vendor my-package
$ php artisan packager:git https://github.com/author/repository my-vendor my-package

It is possible to specify a branch with the --branch option. If you specify a vendor and name directly after the url, those will be used instead of the pieces of the url.

Tests

Command:

$ php artisan packager:tests

Result:Packager will go through all maintaining packages (in packages/) and publish their tests to tests/packages.Add the following to phpunit.xml (under the other testsuites) in order to run the tests from the packages:

<testsuite name="Packages">
    <directory suffix="Test.php">./tests/packages</directory>
</testsuite>

Options:

$ php artisan packager:tests my-vendor my-package

Remarks:If a tests folder exists, the files will be copied to a dedicated folder in the Laravel App tests folder. This allows you to use all of Laravel's own testing functions without any hassle.

List

Command:

$ php artisan packager:list

Result:An overview of all packages in the /packages directory.

Options:

$ php artisan packager:list --git

The packages are displayed with information on the git status (branch, commit difference with origin) if it is a git repository.

Remove

Command:

$ php artisan packager:remove my-vendor my-package

Result:The my-vendor\my-package package is deleted, including its references in composer.json and config/app.php.

Publish

Command:

$ php artisan packager:publish my-vendor my-package https://github.com/my-vendor/my-package

Result:The my-vendor\my-package package will be published to Github using the provided url.

Check

Command:

$ php artisan packager:check my-vendor my-package

Result:The my-vendor\my-package package will be checked for security vulnerabilities using SensioLabs security checker.

RemarksYou first need to run

$ composer require sensiolabs/security-checker

Issues with cURL SSL certificate

It turns out that, especially on Windows, there might arise some problems with the downloading of the skeleton, due to a file regarding SSL certificates missing on the OS. This can be solved by opening up your .env file and putting this in it:

CURL_VERIFY=false

Of course this means it will be less secure, but then again you are not supposed to run this package anywhere near a production environment.

Issues with timeout

If you are having problems with timeouts when creating new packages, you can now change the config variable timeout in config/packager.php to fix this.

Changelog

Please see changelog.md for what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Credits

License

The EU Public License. Please see license.md for more information.

  • 本教程会详细介绍配置的方法,以给全体用户发送通知为例。 1. 广播配置说明 1.1 广播驱动配置 文件位置 config/broadcasting.php <?php return [ 'default' => env('BROADCAST_DRIVER', 'null'), 'connections' => [ 'pusher' => [

  • 在执行composer require "overtrue/laravel-wechat:~5.0" 报错 PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/

  • 镜像地址 : https://segmentfault.com/a/1190000015049847 原文地址: Laravel Mix Docs   概览   基本示例 larave-mix 是位于webpack顶层的一个简洁的配置层,在 80% 的情况下使用 laravel mix 会使操作变的非常简单。尽管 webpack 非常的强大,但大部分人都认为 webpack 的学习成本非常高。但是

  • 前言 之前的项目中,涉及一个生成 PDF 的需求,当时使用的框架是 Lumen。 调研 原本是想用官方网站上可以看到的 PDF 扩展的,发现使用之后有水印,直接放弃。(传送门 好像已经不能打开了) 之后考虑了一下,如果能像浏览器一样,将网页直接转换为 PDF,那该多好,省时省力。 搜索了一下,发现还蛮多。 dompdf 传送门 HTML2FPDF 传送门 mpdf 传送门 但适合这个项目的都需要自

  • laravel与Swoole 参考文档 https://gitee.com/hhxsv5/laravel-s php的docker容器中配置swoole 1.获取swoole安装包 https://pecl.php.net/package/swoole 2.解压swoole安装包 tar –zxvf swoole-4.6.6.tar 3.将解压出来的安装包copy到php容器 docker

 相关资料
  • Laravel 是一套简洁、优雅的PHP Web开发框架(PHP Web Framework)。它可以让你从面条一样杂乱的代码中解脱出来;它可以帮你构建一个完美的网络APP,而且每行代码都可以简洁、富于表达力。 功能特点 1、语法更富有表现力 你知道下面这行代码里 “true” 代表什么意思么? $uri = Uri::create(‘some/uri’, array(), array(), tr

  • 我需要空间/Laravel权限的帮助。当我试图分配它给我错误哎呀,看起来像出了问题。 错误 Connection.php第761行中的QueryExcema:SQLSTATE[23000]:完整性约束冲突:1048列role_id不能为空(SQL:插入到(,)值(9,))

  • Laravel 作为现在最流行的 PHP 框架,其中的知识较多,所以单独拿出来写一篇。 简述 Laravel 的生命周期 Laravel 采用了单一入口模式,应用的所有请求入口都是 public/index.php 文件。 注册类文件自动加载器 : Laravel通过 composer 进行依赖管理,无需开发者手动导入各种类文件,而由自动加载器自行导入。 创建服务容器:从 bootstrap/ap

  • 简介 Laravel Scout 为 Eloquent 模型 全文搜索提供了简单的,基于驱动的解决方案。通过使用模型观察者,Scout 会自动同步 Eloquent 记录的搜索索引。 目前,Scout 自带一个 Algolia 驱动;不过,编写自定义驱动很简单, 你可以轻松的通过自己的搜索实现来扩展 Scout。 安装 首先,通过 Composer 包管理器来安装 Scout: composer

  • 简介 Laravel 致力于让整个 PHP 开发体验变得愉快, 包括你的本地开发环境。 Vagrant 提供了一种简单,优雅的方式来管理和配置虚拟机。 Laravel Homestead 是一个官方预封装的 Vagrant box,它为你提供了一个完美的开发环境,而无需在本地机器安装 PHP 、Web 服务器和其他服务器软件。不用担心会搞乱你的操作系统!Vagrant boxes 是一次性的。如果

  • WebStack-Laravel 一个开源的网址导航网站项目,具备完整的前后台,您可以拿来制作自己的网址导航。 部署 克隆代码: git clone https://github.com/hui-ho/WebStack-Laravel.git 安装依赖: composer installphp artisan key:generate 编辑配置: cp .env.example .env ...D

  • 百度编辑器 For Laravel 5 支持自定义路由, 默认前后台独立控制器,支持重写方法方便自己的业务逻辑处理,支持扩展图片助手(推荐使用Intervention\Image第三方包) 官网 NinJa911工作室. 疑问讨论 请在issue里new一个. 授权 此Laravel 扩展包基于MIT协议开源MIT license. 安装 1.Composer 安装 composer requir

  • laravel-admin是一个基于laravel的后台管理开发框架,能帮助你使用很少的时间和代码量开发出功能完备的管理后台,另外它作为一个三方包,可以和框架内其它项目并行开发,真正做到前后台开发分离。 功能: RBAC权限管理模块。 菜单管理,和权限系统结合。 模型数据表格,能快速构建数据表格,并支持多种模型关系。 模型表单以及30+种form元素组件,自动实现增、删、改功能。 支持本地和云存储