lundi 26 juin 2017

Blade template @push works for js but not for css

I'm using the Laravel-AdminLTE and created the auth views using the make:adminlte command.

Now I want to customize my login page with my own css and js, but i can't use the @push directive in Blade for css files.

I put my files in the public folder:

public/js/login-functions.js
public/css/login-styles.css

Here is my resources/views/auth/login.blade.php (Some text are in Portuguese):

@extends('adminlte::login')

@section('adminlte_css')
    @parent
    @push('css')
        <link href="" />
    @endpush
@endsection


@section('body')
    <div class="container-fluid">
        <div class="row">
            <section class="wrapper">
                <div class="form-signin" role="form" id="form-login">
                    <img class="img-responsive center-block" id="logo" src=""/>

                    <div id="message"></div>
                    <div id="form-acesso">
                        <form accept-charset="UTF-8" role="form" action="/login" method="POST" id="login-entrar">
                            <div class="form-group">
                                <label for="login">Nome de Usuário:</label>
                                <div class="input-group">
                                    <span class="input-group-addon">
                                        @
                                    </span>
                                    <input id="login" name="login" class="form-control" type="text" placeholder="E-mail de acesso" required/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="password">Senha:</label>
                                <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="glyphicon glyphicon glyphicon-lock"></i>
                                    </span>
                                    <input id="password" name="password" class="form-control" type="password" placeholder="Senha de Acesso" required/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="checkbox">
                                    <input type="checkbox" value="remember-me" id="rememberMe" name="rememberMe"> Lembrar
                                </label>
                            </div>
                            <div class="form-group">
                                <button type="submit" class="btn btn-primary btn-block">
                                    Acessar
                                </button>
                                <p class="help-block">
                                    <a class="pull-right text-muted" href="#" id="lembrar"><small>Esqueceu a senha?</small></a>
                                </p>
                            </div>
                        </form>
                    </div>
                    <div style="display: none;" id="form-lembrar">
                        <h4>
                            Esqueceu sua senha?
                        </h4>
                        <form accept-charset="UTF-8" role="form" id="login-lembrar">
                            <fieldset>
                                <span class="help-block">
                                  Insira o seu endereço de e-mail usado para entrar no sistema
                                  <br>
                                  Será enviado um e-mail com as instruções para criar uma nova senha.
                                </span>
                                <div class="form-group input-group">
                                <span class="input-group-addon">
                                    @
                                </span>
                                    <input class="form-control" placeholder="Email" name="email" type="email" required="">
                                </div>
                                <button type="submit" class="btn btn-primary btn-block" id="btn-lembrar">
                                    Enviar
                                </button>
                                <p class="help-block">
                                    <a class="text-muted" href="#" id="acceso"><small>Voltar a página de acesso</small></a>
                                </p>
                            </fieldset>
                        </form>
                    </div>
                </div>

            </section>
        </div>
    </div>
    @push('js')
        <script src=""></script>
    @endpush
@overwrite

The problem is: The js is included and works fine, but css don't, I already tried to put the @push('css') out of any @section and also inside @section('body'), but the result is the same.

What I'm doing wrong here?

For reference:

  • Laravel 5.4
  • The original file from Laravel-AdminLTE (resources/views/vendor/adminlte/login.blade.php) is pasted here.


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire