Reputation: 11
I connect bootstrap, but laravel cant find styles app.blade.php:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="csrf-token" content="={{csrf_token()}}">
<title>@yield('title-block')</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="public/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="public/css/style.css">
</head>
<body>
@yield('content')
</body>
</html>
<?php
registration.blade.php:
@extends('layouts.app')
@section('title-block')
Регистрация
@endsection
@section('content')
<div class="container">
<h1 align="center">
{{-- <a href="index.html"><img src="img/logo.jpg" alt="logo" class="home"></a>--}}
Register
</h1>
</div>
<hr>
<form name="register" method="POST" action="{{route('user.registration')}}">
@csrf
<input class="text-input" type="text" placeholder="Enter your surname" name="surname" required>
<input class="text-input" type="text" placeholder="Enter your name" name="name" required><br>
<input class="text-input" type="text" placeholder="Enter your number" name="number" required><br>
<input class="text-input" type="text" placeholder="Enter your father`s name" name="fathers_name" required>
<input class="text-input" type="text" placeholder="Enter parent number" name="parents_number" required><br>
<input class="text-input-full-width" id="password" name="password" type="password" required placeholder="Enter password"><br>
<button class="btn btn-lg btn-primary" type="submit" name="sendMe" value="1">Войти</button>
</form>
@endsection
I am beginner and dont understand why laravel dont see styles.css. I have try this
but its doesn`t work. I hope you can help me enter image description here
Upvotes: 0
Views: 279
Reputation: 11
I find answer. I can only use <link rel="stylesheet" type="text/css" href="css/style.css">
without "public/"
Upvotes: 0
Reputation: 620
You can use simply <link rel="stylesheet" type="text/css" href="/css/bootstrap.css">
For Laravel
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.css')">
And Add ASSET_URL="${APP_URL}"
in .env file.
Don't Forget to clear views & cache
php artisan view:clear
php artisan config:cache
Upvotes: 0