美文网首页
laravel第三方扩展

laravel第三方扩展

作者: 冰淤 | 来源:发表于2016-04-29 11:20 被阅读1393次

    实现QQ,微信登陆

    包:https://github.com/weann/socialite

    使用方法和github上说的一样,不同的地方:

    修改包文件下的SocialiteServiceProvider.php的29行,bindShared改成singleton

    使用七牛云SDK

    包:https://github.com/zgldh/qiniu-laravel-storage

    在filesystem.php的配置中,default填入自定义域名

    由于这个包在获取上传token时需要传参,所以修改包文件下的QiniuStorage.php的uploadToken方法,把参数$key去掉。

    修改数据表中的列

    需要导入这个包

    composer require doctrine/dbal

    操作文档:http://laravelacademy.org/post/2965.html#ipt_kb_toc_2965_9

    使用dingoAPI和jwt-auth

    dingo:https://github.com/dingo/api

    为了使用laravel表单验证功能,需要将

    App\Http\Requests\Request.php中的:

    use Illuminate\Foundation\Http\FormRequest;

    改为:

    use Dingo\Api\Http\FormRequest;


    JWT:wiki:https://github.com/tymondesigns/jwt-auth/wiki

    传输令牌:

    在请求的header中添加:

    key:Authorization

    value:Bearer + 空格 + token的值

    刷新令牌(不需要任何jwt中间件,只需要use JWTAuth):

    $oldToken = JWTAuth::getToken();

    $token = JWTAuth::refresh($oldToken);

    return response()->json(compact('token'));

    使用geetest验证码服务

    laravel包:https://github.com/JellyBool/geeCaptcha

    因为没有更新composer的包,所以要直接下载zip包

    视频教程:https://laravist.com/series/tools-that-are-dame-good-for-developer/episodes/1

    使用roles权限管理包

    文档:https://github.com/romanbican/roles

    修改Auth/User.php:http://pan.baidu.com/s/1pKSdfAF

    命令行进入项目目录下

    scp vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php username@your_ip:/var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php

    PS:每次执行composer install/update后都要scp一次。

    相关文章

      网友评论

          本文标题:laravel第三方扩展

          本文链接:https://www.haomeiwen.com/subject/ffnhrttx.html