Laravelのビューで$errors(Illuminate\View\Middleware\ShareErrorsFromSession)の情報のkeyの値を取得したいのですがうまく取得できませんでした。
画像はdd($errors)の情報になります。
画像の中の”App\Http\Requests\Receipt\ReceiptDeleteRequest”を取得してビュー内で使用しようと思ってます。
よろしくお願いします。
補足
<?php namespace App\Http\Requests\Receipt; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Contracts\Validation\Validator; use Illuminate\Validation\ValidationException; use Log; use App\Rules\CheckUnworkedReceipt; use App\Rules\ItemCodeExists; use App\Rules\ReservationStockItemNotExists; use App\Rules\ReceiptIsNotDone; use App\Rules\ReceiptQuantityIsNotExceed; use App\Services\GetNeedForExpirationDateByReceiptedItem; use App\Services\Shopify\GraphQL\Query\FetchShopService; use App\Services\GetDateFormatService; use App\Services\DB\ReceiptedItem\SelectReceiptedItemByItemBarcode; use App\Services\CreateCarbonByFormatSettingAndDatestring; class ReceiptDeleteRequest extends FormRequest { private $const; protected $errorBag; public function __construct() { parent::__construct(); $this->const = config('const'); $this->errorBag = get_class($this); //ここの設定の仕方が間違っている????? } public function authorize() { return true; } public function rules() { $rules = [ 'receiptNo' => [new CheckUnworkedReceipt($this->receiptNo)] //falseになる(バリデーションひっかかる) ]; return $rules; } protected function failedValidation(Validator $validator) { Log::channel($this->processType)->info("$this->processName バリデーションエラー", $validator->errors()->all()); throw (new ValidationException($validator)) ->errorBag($this->errorBag) ->redirectTo($this->getRedirectUrl()); } }

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。