最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to use bootstrap with Laravel 5.2 - Stack Overflow

programmeradmin0浏览0评论

I need use bootstrap 3 with My Laravel app. I have download bootstarp and paste it Laravel public-css folder. now I need integrate its with My Laravel app. how can I do this? I do not use bootstrap theme. only css and js files. I need exit cdn.

I need use bootstrap 3 with My Laravel app. I have download bootstarp and paste it Laravel public-css folder. now I need integrate its with My Laravel app. how can I do this? I do not use bootstrap theme. only css and js files. I need exit cdn.

Share Improve this question asked Jun 10, 2017 at 11:04 flexflex 1151 gold badge3 silver badges9 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 2

I found an solution try this one

download the bootstrap package and

    copy bootstrap.min.css into your public/css folder
    copy bootstrap.min.js into your public/js folder

Add the following to the head area of app.blade.php

<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">

Before the closing in app.blade.php add

<script src="https://ajax.googleapis./ajax/libs/jquery/1.12.4/jquery.min.js"></script>

<script src="{{ asset('js/bootstrap.min.js') }}"></script>

Laravel 5.2 es with bootstrap sass in place. You can find it under the resources directory:

https://github./laravel/laravel/blob/5.2/resources/assets/sass/app.scss

Just unment the @import line and build the public resources with gulp or something. To include the javascript just include it in your document head like you would any other resource.

<script src="https://cdnjs.cloudflare./ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>

after past myapp/public/css/bootstrap.min.css file

you have to import css boostrap sourse,

<link rel="stylesheet" href="<?php echo asset ('css/bootstrap.min.css')?>" type="text/css">

Bootstrap is already included with Laravel. On Laravel 5.8 it is under public/css/app.css location

you just need to add the file to the blade template to use bootstrap like this

  **<link href="{{ asset('css/app.css') }}" rel="stylesheet">**

发布评论

评论列表(0)

  1. 暂无评论