php - Laravel Doesn't see Routes in Scaffolded Auth login
问题描述
Code:
<div class="col-sm-6 text-right">
<a href="{{ route('password.request') }}">forgot?</a>
</div>
Error:
Parse error: syntax error, unexpected 'password' (T_STRING), expecting ',' or ')' (View: /path/to/laravel/resources/views/auth/login.blade.php)
When I'm trying to vardump route('password.request') in Tinker it's OK, but Tinker uses PHP 7.1.19 and the web interface 7.1.11 (if that is important).
Stack trace:
1. {main}() /home/app/path/public/index.php:0
2. Symfony\Component\Debug\Exception\FatalThrowableError->() /home/vagrant/www/tonezone/storage/framework/views/e994cd5027a170d4c5b3b3e08ce6dd81af433087.php:39
3. {main}() /home/app/path/public/index.php:0
Line 39:
<a href="<?php echo e(route('password.request')); ?>"><?php echo app('translator')->getFromJson('forgot?'); ?></a>
解决方案
If 'password.request' was a string it wouldn't give an error, so I think your quotation marks are inverted.
I would guess that you probably missed one quotation mark in the previous statement in braces. Maybe you were adding translations? It's easy to miss something like it.
推荐阅读
- python - 查找并遍历文件中的每个部分?
- r - tidyverse:选择每年内具有相同水平因子的行
- anaconda - 什么可能是另一个环境?人工智能学习
- python - 谷歌日历 API——“超出未经验证使用的每日限制。继续使用需要注册”
- selenium - org.openqa.selenium.InvalidElementStateException:无效元素状态:元素必须是用户可编辑的才能清除它
- python - 训练模型后的预测值问题
- javascript - 如何使用 NodeJS 在 Windows 和 Linux 机器上读取同一项目中的绝对路径?
- c++ - 如何将字符显示为显示板上的字符串?
- c++ - Intellisense 未在 Visual Studio 2019 中显示 cmake 项目的语法错误
- node.js - 异步使用 writeFile 时,fileSystem 模块出现错误