定制 fjarfs/src-general 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fjarfs/src-general

最新稳定版本:v0.0.1

Composer 安装命令:

composer require fjarfs/src-general

包简介

Function General SRC environment

README 文档

README

Total Downloads Latest Stable Version License

SRC General merupakan package yang digunakan oleh aplikasi SRC dan berisi tentang function-function yang bersifat general

Cara Install

  • composer require fjarfs/src-general

    Laravel
    • Otomatis terdaftar oleh Laravel Package Discovery
    Lumen
    • Daftarkan service provider di bootstrap/app.php
       $app->register(Fjarfs\SrcGeneral\SrcGeneralProvider::class);

Function yang tersedia

Cara Penggunaan

  • Access

    Access Module

      use Fjarfs\SrcGeneral\Helpers\Access as AccessModule;
     
     AccessModule::module('http://localhost/api/v1/user/principal/user', $auth);

    contoh:

    <?php
    
    namespace App\Http\Middleware;
    
    use Closure;
    use App\Libraries\Services\Core\Auth;
    use Fjarfs\SrcGeneral\Helpers\Access as AccessModule;
    
    class Access
    {
        /**
         * Handle an incoming request.
         *
         * @param  \Illuminate\Http\Request  $request
         * @param  \Closure  $next
         * @return mixed
         */
        public function handle($request, Closure $next)
        {
            $auth = Auth::info();
            if ($auth) {
                if (AccessModule::module($request->path(), $auth) == false) {
                    return response()->json(['message' => 'Tidak ada otorisasi'], 401);
                }
            }
            
            return $next($request);
        }
    }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-16