我尝试使用Toastr通知,但未显示,我发现了问题,但我不知道该如何解决, 问题:
我认为我在某个地方有一些错误,但是我不知道在哪里..我花了一个星期的时间来尝试解决此问题,但是它不起作用!任何人都可以帮助!
@extends('layouts.app')
@section('content')
我的layouts.app:
<!DOCTYPE html>
<html lang=" {{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('css/toastr.min.css') }}" rel="stylesheet">
<link href="https://codeseven.github.io/toastr/build/toastr.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="app">
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<!-- Collapsed Hamburger -->
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Branding Image -->
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
</div>
<div class="collapse navbar-collapse" id="app-navbar-collapse">
<!-- Left Side Of Navbar -->
<ul class="nav navbar-nav">
</ul>
<!-- Right Side Of Navbar -->
<ul class="nav navbar-nav navbar-right">
<!-- Authentication Links -->
@if (Auth::guest())
<li><a href="{{ route('login') }}">Login</a></li>
<li><a href="{{ route('register') }}">Register</a></li>
@else
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
Logout
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
</li>
</ul>
</li>
@endif
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
@if(Auth::check())
<div class="col-lg-4">
<ul class="list-group">
<li class="list-group-item">
<a href="{{ route('home') }}">Home</a>
</li>
<li class="list-group-item">
<a href="{{ route('categories') }}">All Categories</a>
</li>
<li class="list-group-item">
<a href="{{ route('category.create') }}">Create Category</a>
</li>
<li class="list-group-item">
<a href="{{ route('post.create') }}">Create new post</a>
</li>
</ul>
</div>
@endif
<div class="col-lg-8">
@yield('content')
</div>
</div>
</div>
</div>
</div>
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}"></script>
<script src="{{ asset('js/toastr.min.js') }}"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://codeseven.github.io/toastr/build/toastr.min.js"></script>
<script src="https://codeseven.github.io/toastr/glimpse.js"></script>
<script src="https://codeseven.github.io/toastr/glimpse.toastr.js"></script>
<script>
@if(Session::has('success'))
toastr.success("{{ Session::get('success') }}")
@endif
</script>
</body>
</html>
答案 0 :(得分:0)
如果您要删除
,我也遇到同样的问题<script src="{{ asset('js/app.js') }}"></script>
Toastr可以工作,但我不知道如何解决。