php - Laravel macOS 输入中的意外字符:'
问题描述
我使用 Parallels 提供程序在我的 macOS 上安装了 Vagrant。我使用命令创建了一个新项目laravel new blog
。
当我打开网站时,一切正常。然后我想用这些命令添加一个身份验证:php artisan make:auth
php artisan migrate
第一个命令工作正常,但第二个产生错误:
PHP警告:输入中的意外字符:'在/home/vagrant/blog/routes/web.php第17行
我发现问题出在流浪盒子“宅基地”和 macOS 之间。因为在我关闭了宅基地和 macOS 之间的同步并重新安装了整个项目之后它工作正常。那你能告诉我问题出在哪里吗?是字符集吗?
这就是我的 web.php 的样子(我没有做任何更改):
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
解决方案
它也发生在我身上。启用 NFS 解决了我的问题。不知道是什么原因。
宅基地.yaml
folders:
- map: ~/code
to: /home/vagrant/code
type: "nfs"
推荐阅读
- laravel - Laravel Yajra 数据表未安装
- html - div底部的CSS对齐按钮
- mysql - 将关系数据库转换为非关系数据库的最佳实践?
- php - 如果它们返回 false,用于删除的雄辩事件是否可以停止?
- jms - 无法在同步队列上发回消息(定时器已取消)
- c++ - 在 GLFW 窗口中显示 FFMPEG 解码帧
- google-chrome-extension - 加载选项卡后在 chrome 扩展中获取选项卡 URL
- python - 将 num2words 应用于整数列表
- scala - Scala - 使用谓词函数来总结字符串列表
- php - 使用 Doctrine MongoODM 模块连接到 Mongo 副本集