Ich habe Probleme bei der lokalen Verwendung von Bootstrap, wenn ich Bootstrap wie folgt verwende:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
Es l?dt sehr schnell, aber wenn ich Bootstrap herunterlade und es lokal im ?ffentlichen Ordner verwende, so:
<link rel="stylesheet" href="{{ asset('bootstrap/css/bootstrap.min.css') }}" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
Ich erhalte die Fehlermeldung ?Maximale Ausführungszeit 60 Sekunden überschritten“, der Ordner ist korrekt in ?public/bootstrap/css/bootstrap.min.css“ abgelegt, wie kann ich das beheben?
Das ist meine index.php
<?php /** * Laravel - A PHP Framework For Web Artisans * * @package Laravel * @author Taylor Otwell <taylor@laravel.com> */ define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader for | our application. We just need to utilize it! We'll simply require it | into the script here so that we don't have to worry about manual | loading any of our classes later on. It feels great to relax. | */ require __DIR__ . '/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- | Turn On The Lights |-------------------------------------------------------------------------- | | We need to illuminate PHP development, so let us turn on the lights. | This bootstraps the framework and gets it ready for use, then it | will load up this application so that we can run it and send | the responses back to the browser and delight our users. | */ $app = require_once __DIR__ . '/../bootstrap/app.php'; /* |-------------------------------------------------------------------------- | Run The Application |-------------------------------------------------------------------------- | | Once we have the application, we can handle the incoming request | through the kernel, and send the associated response back to | the client's browser allowing them to enjoy the creative | and wonderful application we have prepared for them. | */ $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); $response = $kernel->handle( $request = Illuminate\Http\Request::capture() ); $response->send(); $kernel->terminate($request, $response);
嘗試使用 npm 安裝它并使用 Laravel Mix 編譯它。這非常容易做到。
在您的控制臺(tái)中
npm install bootstrap npm update
在您的/resources/js/app.js
import 'bootstrap'; import 'bootstrap/dist/css/bootstrap.min.css';
最后,在您的 /resources/views/layout.blade.php
現(xiàn)在,我們可以像這樣編譯腳本:
npm run dev
第一次嘗試就為我工作了。