小编Tha*_*han的帖子

为什么我的 AWS 代入角色无权执行 cognito-idp:AdminGetUser?

我的 Laravel 应用程序调用AdminGetUser端点。

在本地环境中,成功返回资源。

部署到 Vapor 环境后,失败并出现以下错误消息:

User: arn:aws:sts::xxxx:assumed-role/laravel-vapor-role/xxxx is not authorized to perform: **cognito-idp:AdminGetUser** on resource: arn:aws:cognito-idp:us-east-1:xxxx:userpool/us-east-1_xxxx because no identity-based policy allows the cognito-idp:AdminGetUser action
Run Code Online (Sandbox Code Playgroud)

有什么问题吗?

amazon-cognito aws-lambda laravel-vapor

9
推荐指数
1
解决办法
2万
查看次数

爆炸中如何替换阵列键

我有下面的代码

$string = "Trainee,Beginner";
Run Code Online (Sandbox Code Playgroud)

我想用爆炸替换$ string到数组对象

$list = explode(',', $string);
Run Code Online (Sandbox Code Playgroud)

我得到的结果。

array:2 [?
  0 => "Trainee"
  1 => "Beginner"
];
Run Code Online (Sandbox Code Playgroud)

我想要的结果。

array:2 [?
  'Trainee' => "Trainee"
  'Beginner' => "Beginner"
];
Run Code Online (Sandbox Code Playgroud)

php laravel

4
推荐指数
1
解决办法
81
查看次数

未定义的属性:Illuminate\Support\Facades\Request::$email

我是 laravel 的新手,我正在尝试制作一个简单的注册和登录表单,注册表单在数据库中注册用户并登录表单登录用户,但是在这里我遇到了这个错误,我试图解决这个问题已经好几个小时了进入许多资源但无法弄清楚,任何帮助将不胜感激..谢谢

错误:未定义的属性:Illuminate\Support\Facades\Request::$email

刀刃

@extends("layouts.master")

@section('title')
  My page
@endsection

@section('content')
  <div class="row">
    <div class="col-md-6">
      <h3>Sign-Up</h3>
      <form action="{{ route('signup') }}" method="post">

        <div class="form-group">
          <label for="email">Your email</label>
          <input class="form-control" type="text" name="email" id="email">
        </div>

        <div class="form-group">
          <label for="first_name">First Name</label>
          <input class="form-control" type="text" name="first_name" id="first_name">
        </div>

        <div class="form-group">
          <label for="password">Password</label>
          <input class="form-control"  type="password" name="password" id="password">
        </div>

        <button type="sumbit" class="btn btn-primary">sumbit</button>
        <input type="hidden" name="_token" value="{{ Session::token() }}">

      </form>
    </div>

    <div class="col-md-6">
      <h3>Login </h3>
      <form action="{{ route('signin') }}" method="post">

        <div class="form-group">
          <label for="email">Your email</label>
          <input …
Run Code Online (Sandbox Code Playgroud)

laravel

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

Laravel:雄辩的orderBy hasOne关系列与with

我有一个OrdershasOne关系的模型participant

public function participant()
{
    return $this->hasOne('App\OrderParticipant', 'order_id');
}
Run Code Online (Sandbox Code Playgroud)

我需要检索Orders排序依据participant.last_name

我的方法

$orders = \App\Orders::with(['participant',])
              ->where('user_id', $user->id)  
              ->orderBy('participant.last_name')
              ->get();
Run Code Online (Sandbox Code Playgroud)

失败:

未定义的表:7错误:缺少表\“参与者\” \ nLINE的FROM子句条目:... 1

收集后我已经尝试对它进行排序

return $orders->sortBy('participant.last_name');
Run Code Online (Sandbox Code Playgroud)

但这根本没有排序

顺便说一句我正在使用postgres

谢谢。

php laravel laravel-5 laravel-5.7

0
推荐指数
1
解决办法
287
查看次数