# 开发laravel扩展 **Repository Path**: plasr/laravelkuoz ## Basic Information - **Project Name**: 开发laravel扩展 - **Description**: 学习开发laravel扩展 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2017-05-02 - **Last Updated**: 2024-11-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # laravel扩展学习 1.根据兴建目录 packages/laravist/hasher/src/ 2.composer.json文件中 autoload下的psr-4里面添加"Laravist\\Hasher\\":"packages/laravist/hasher/src/",表示src里面的文件使用Laravist\Hasher\这个命名空间 3.composer dump-autoload更新composer 4.生成 php artisan make:provider MD5HasherProvider。存放在app\Providers,赋值到src目录。更改命名空间 6.注册服务 \Laravist\Hasher\MD5HasherProvider::class, config/app.php 7.进入packages/laravist/hasher/ composer init 安装 ```shell PS D:\WWW\pl\2017\05\laravelkuoz\packages\laravist\hasher> composer init Welcome to the Composer config generator This command will guide you through creating your composer.json config. Package name (/) [administrator/hasher]: plpackagist/hasher_plx Description []: MD5 Author [qq2504021719 <1104534940@qq.com>, n to skip]: Minimum Stability []: dev Package Type (e.g. library, project, metapackage, composer-plugin) []: License []: MIT Define your dependencies. Would you like to define your dependencies (require) interactively [yes]? NO Would you like to define your dev dependencies (require-dev) interactively [yes]? no { "name": "plpackagist/hasher_plx", "description": "MD5", "license": "MIT", "authors": [ { "name": "qq2504021719", "email": "1104534940@qq.com" } ], "minimum-stability": "dev", "require": {} } Do you confirm generation [yes]? yes composer.json 文件 { "name": "plpackagist/hasher_plx", "description": "MD5", "license": "MIT", "authors": [ { "name": "qq2504021719", "email": "1104534940@qq.com" } ], "minimum-stability": "dev", "require": {}, "autoload": { "psr-4": { "Laravist\\Hasher\\":"src/" } }, } ``` 8.推送到github 然后settings->integrations&services->Add service->packagist->输入packagist的用户名,token(用户-profile),最后一个可以不填写 9.packagist->submit->复制github链接,然后check,直到按钮check变成submit 10.win7git创建标签,右键->TortoiseGit->创建标签->提交,右键->同步->选择推送标签(推送下拉)