Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
18
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

Laravel5にtwitter bootstrapを導入する

実はLaravel5には最初からBootstrap3が導入されています。

以下の場所に格納されています。

public/
└── css
     └── app.css

resources/
└── assets
     └── less
       └── bootstrap
           └── *.less

Bootstrapはlessというcssを拡張した言語で書かれており、そのlessファイルをcssにコンパイルしたものがapp.cssです。

Boostrapを使うためには、

// resources/views/app.blade.php

<!DOCTYPE HTML>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <title>My Blog</title>

    <!-- CSS --><!-- 追加 -->
    <link href="/css/app.css" rel="stylesheet">
</head>

<body>     
    <!-- Scripts --><!-- 追加 -->
    <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>
</body>
</html>

とすればokです。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
18
Help us understand the problem. What are the problem?