XAMPP + Laravel + AdminLTE

好吧,当我发现pipe理员Dash Laravel模板将整个AdminLTE模板连接到Laravel 5.4时,包括示例页面,数据库表格等,只是为了在我的本地XAMPP上运行时碰到一个障碍服务器…

我按照说明和:

  • Z:/xampp/htdocs/目录下通过laravel new test3创build了一个新的Laravel项目。
  • 下载Admin-Dash文件并将其粘贴到新的项目文件夹(test3)
  • php artisan migration
  • 运行npm install
  • 编辑我的.env文件指向正确的文件夹APP_URL=http://localhost/test3

这导致了这一点: 在这里输入图像说明

假设提供的站点如/login//register/和CSS / JSfunction似乎都不起作用,很可能是由于模板在http://localhost/dist/寻找dist文件夹,在Z:/xampp/htdocs/test3/public/dist

如何更改模板中的文件夹目标? 感谢任何帮助,谢谢! A2K

编辑

如前所述,css / js文件夹位置存在问题。 我已经在Z:\xampp\htdocs\test3\resources\views\layouts了Admin / Guest / Common的刀片,并将它们调整为如下所示:

例如。 jQuery的

 <!-- jQuery 2.2.3 --> <script src="/plugins/jQuery/jquery-2.2.3.min.js"></script> to <!-- jQuery 2.2.3 --> <script src="/test3/public/plugins/jQuery/jquery-2.2.3.min.js"></script> 

这似乎最终解决了布局问题,但是当点击任何链接,例如。 /register/它指向我http://localhost/register/而不是http://localhost/test3/register/ 。 它不应该有必要乱用主刀片configuration,这让我想知道是否有一个主pipe设置的pipe理代表path,我失踪了?

编辑2

由于CSS / JS问题是通过利用{{ asset }} ,唯一的问题就是路由。 现在,当导航到例如http://localhost/test3/register/我收到一个404错误,提示APP URL或路由问题。 下面两个:

本地主机/ TEST3 /路线/ web.php

 // Registration routes Route::get('register', 'Auth\AuthController@showRegistrationForm')->name('register'); Route::post('register', 'Auth\AuthController@register'); 

本地主机/ TEST3 /configuration/ app.php

 'url' => env('APP_URL', 'http://localhost/test4'), 

控制台的最新截图: 在这里输入图像说明

首先,从src="/test3/public/plugins/jQuery/jquery-2.2.3.min.js"删除/test3 。 然后,像下面这样定义css/jspath: {{ asset('plugins/jQuery/jquery-2.2.3.min.js') }}

确保你有jquery-2.2.3.min.js plugins/jQuery/目录!

config/app.php更改,如url' => env('APP_URL', 'http://localhost/test4'),

使用项目通过创buildvirtualhost容易,也为实现和redirect!

希望这一步可能会解决你的问题! 🙂

你应该做:
1)安装composer php的依赖关系

 composer install 

2)需要使用该命令生成应用密钥

 php artisan key:generate 

3)在代码编辑器中打开项目,将.env.example重命名为.env并修改您的环境中的数据库名称,用户名,密码。

4)与种子一起迁移数据库

 php artisan migrate --seed 

编辑 :你可以给每个路线添加前缀'test3',像这样:

 Route::prefix('test3')->group(function () { //your all routes inside here }); 

请点击此处查看更多信息: route-group-prefixes

Interesting Posts