vendredi 26 octobre 2018

why did not work external js file in laravel 5.6?

working with laravel 5.6 and I have following sidemenu bar blade file,

<div class="list-group">

    <a href="#" class="list-group-item active"><i class="fa fa-key"></i> <span>App Settings</span></a>
    <a href="" class="list-group-item" ><i class="fa fa-credit-card"></i> <span>My Ads</span></a>
    <a href="#" class="list-group-item"><i class="fa fa-question-circle"></i> <span>Support</span></a>
    <a href="#" class="list-group-item"><i class="fa fa-arrow-circle-o-left"></i> <span>Sandbox Account</span></a>
    <a href="#" class="list-group-item"><i class="fa fa-book"></i> <span>QuickStart Overview</span></a>
    <a href="#" class="list-group-item"><i class="fa fa-compass"></i> <span>Documentation</span></a>
</div>

links of the sidemenu bar blade file,

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

and sidebar.js file,

$(document).ready(function() {
  $('.list-group-item').click(function(e) {
    e.preventDefault();
    $('.list-group-item').removeClass('active');
    $(this).addClass('active');
  });
});

above js file is using highlight current page, and above codes using in my blade file as following,

@extends('layouts.app')
<script src=""></script>
@section('head')

    <link rel="stylesheet" href="">
@endsection
@section('content')
<div class="container"> 
    <div class="row">
    @include('_includes.nav.sidebar') 
        <div class="col-md-5 col-md-offset-1">
            @include('layouts.partials.alerts') 
@forelse( $vehicles as $vehicule )
           @if( $vehicule->uploads->count() > 0 )
                        <a href="">
                            @php
                                $upload = $vehicule->uploads->sortByDesc('id')->first();
                            @endphp
                            <img src="/images/"></a>
                            
                          
<br>

<td><a class="button is-outlined" href="" >Edit</a></td>
                            <td><a class="button is-outlined" href="/myads//delete" onclick="return confirm('Are you sure to want to delete this record?')" >Delete</a></td>
                        </a> 
                    <hr>
                    @endif

            @empty
                <td>No Advertisment to display.</td>
            @endforelse
</div>

</div>
</div>
@endsection

but in my above file it is not highlight current blade file, what is the wrong, how can fix this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire