小编The*_*ind的帖子

作曲家无法安装laravel /护照

我用它创建了一个新项目

laravel new blogposts
Run Code Online (Sandbox Code Playgroud)

使用全局安装在我的ubuntu 18上的"Laravel Installer 2.0.1".

当我试图使用安装护照

composer require laravel/passport
Run Code Online (Sandbox Code Playgroud)

以下错误是他们的

Using version ^6.0 for laravel/passport
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.  

Problem 1
- Conclusion: don't install laravel/passport v6.0.6

- Conclusion: don't install laravel/passport v6.0.5
- Conclusion: don't install laravel/passport v6.0.4
- Conclusion: don't install laravel/passport v6.0.3
- Conclusion: don't install laravel/passport v6.0.2
- Conclusion: don't install …
Run Code Online (Sandbox Code Playgroud)

php laravel composer-php laravel-passport

12
推荐指数
3
解决办法
4955
查看次数

请求头缺少授权 - Codeigniter rest

我正在使用 Codeigniter 休息服务器和 firebase php-jwt 创建一个宁静的服务。创建了一个 api 来返回操作员列表。要访问此 api 客户端必须在标头中发送令牌。示例请求是 -

GET /index.php/operators/prepaid HTTP / 1.1
主机:testing.mydomain.in
授权:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjExNTIxNCIsImlhdCI6MTUxNzk4MjU1NywiZXhwIjoxNTE4MDAwNTU3fQ.PZYh3OlSsKGo_ihPPSm7RrU5BbTNaeTN1fKlNcOZ2r4
缓存控制:无缓存
邮差令牌:933f3b1d-7934-D30A-11bf-f80f3912f433

控制器代码

use \Firebase\JWT\JWT;
class Operators extends REST_Controller 
{
    private $_payload;

    public function __construct($config = 'rest')
    {
        parent::__construct($config);
        $token = $this->input->get_request_header('Authorization');
        if(!$token) {
            $output = array("Error" => "Access Denied");
            $this->response($output, REST_Controller::HTTP_UNAUTHORIZED);
        }
        try {
            $this->_payload = JWT::decode($token, $this->config->item('jwt_secret_key'),array('HS256'));
        } catch (Exception $ex) {
            $output = array("Error" => $ex->getMessage());
            $this->response($output, REST_Controller::HTTP_UNAUTHORIZED);
        }
        $this->load->model('Operators_Data');
    }       

    public function prepaid_get()
    { 
        $operators = $this->Operators_Data->getOperatorsByService(1);
        $this->response($operators); …
Run Code Online (Sandbox Code Playgroud)

php rest codeigniter jwt

6
推荐指数
1
解决办法
7824
查看次数

标签 统计

php ×2

codeigniter ×1

composer-php ×1

jwt ×1

laravel ×1

laravel-passport ×1

rest ×1