Datetimepicker only showing some parts of the picker function - php

I'm trying to get the datetimepicker working that can be found here
I installed this package using bower and linked all the stylesheets / js files.
When I visit the page I can only see some parts of the the actual datepicker.
Here are some pictures to have a better look:
My links:
<!-- Scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="{{ asset('js/jquery.min.js') }}" defer></script>
<script src="{{ asset('tether/dist/js/tether.min.js') }}" defer></script>
<script src="{{ asset('js/moment.min.js') }}" defer></script>
<script src="{{ asset('js/app.js') }}" defer></script>
<script src="{{ asset('js/bootstrap-datetimepicker.min.js') }}" defer></script>
<script src="{{ asset('js/bootstrap.min.js') }}" defer></script>
<!-- Styles -->
<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ asset('css/bootstrap-datetimepicker.min.css') }}" rel="stylesheet">
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('css/style.css') }}" rel="stylesheet">
My HTML:
#extends ('layouts.app')
#section ('content')
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
</div>
#endsection
What am I missing here?

Try specifying the format:
$('#datetimepicker1').datetimepicker({
format: 'MM/dd/YYYY'
});
According to the documentation, the format specified in the options defines what components are shown.

Related

No idea why my livewire function is not working, just goes to a blank page after clicking function?

I have a livewire function that is not firing for some reason and I have no idea why?
This is what the blade view looks like:
all_users.blade.php:
<div>
#livewire('add-friend')
</div>
add-friend.blade.php:
When I click the addToFriend function it goes to a blank page, I have no idea why it isn't working
<div>
#foreach ($users as $user)
<div class="container2">
#if($user->attributes==null)
<img class="profImg" src="{{ url('storage/images/default-image-620x600.jpeg') }}"/>
<p> {{$user->name}}</p>
<p >Grade is: ?</p>
<p >Age is: ?</p>
<p >Country is: ?</p>
#endif
#if($user->attributes!=null)
#if($user->attributes->ProfileImage!=null)
<img class="profImg" src="{{ url('storage/images/'.$user->attributes->ProfileImage) }}"/>
#else
<img class="profImg" src="{{ url('storage/images/default-image-620x600.jpeg') }}"/>
#endif
<p> {{$user->name}}</p>
<p>Gender {{$user->attributes->Gender}}</p>
#if($user->attributes->GradeLevel!=null)
<p >Grade is: {{$user->attributes->GradeLevel}}</p>
#else
<p >Grade is: ?</p>
#endif
#if($user->attributes->Age!=null)
<p class="ex1">Age is {{$user->attributes->Age}}</p>
#else
<p >Age is: ?</p>
#endif
#if($user->attributes->Country!=null)
<p>Country is {{$user->attributes->Country}}</p>
#else
<p>Country is: ?</p>
#endif
#endif
#if(Auth::user()->hasSentFriendRequestTo($user))
<x-button type="submit" class="btn btn-red">Requested</x-button>
#elseif(Auth::user()->isFriendWith($user))
<x-button class="btn btn-green" type="submit" >Friends</x-button>
#else
<form wire:submit.prevent="addToFriend" method="POST">
<input type="number" wire:model="user" value="{{$user->id}}" >
#csrf
<x-button type="submit" class="btn btn-warning"> Add Friend</x-button>
</form>
</div>
#endforeach
</div>
This is what the AddFriend component looks like as well:
class AddFriend extends Component
{
public $user;
public function render()
{
$users = User::where('id', '!=', Auth::user()->id)->limit(14)->latest()->get();
$usersid=User::orderBy('created_at', 'desc')->pluck('id');
return view('livewire.add-friend',
['users'=>$users]);
}
public function addToFriend(User $user)
{
$username = Auth::user();
$recipient = User::find($user->id);
if ($username->befriend($recipient)) {
$this->dispatchBrowserEvent('alert', ['type' => 'success', 'message' => 'Request has been sent!']);
} else {
$this->dispatchBrowserEvent('alert', ['type' => 'error', 'message' => 'Request has been failed!']);
}
}
}
App.blade.php:
This is what the app.blade.php looks like:
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Social climbers') }}</title>
<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght#400;600;700&display=swap">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/1.9.6/tailwind.min.css">
<link rel="stylesheet" href="https://unpkg.com/#tailwindcss/typography#0.2.x/dist/typography.min.css" />
<!-- Styles -->
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
<script src="{{ asset('js/app.js') }}" defer></script>
<script src="scripts/jquery.js"></script>
#livewireStyles
<!-- Scripts -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="{{ asset('js/app.js') }}" defer></script>
</head>
<body class="font-sans antialiased">
#livewireScripts
<div class="min-h-screen bg-gray-100">
#include('layouts.navigation')
<!-- Page Heading -->
<header class="bg-white shadow">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
</div>
</header>
<!-- Page Content -->
<main>
#yield('content')
</main>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="{{asset('js/bootstrap.js')}}"></script>
</body>
</html>

problem in using select2 in my laravel project

my link stylesheet is
<link rel="canonical" href="https://getbootstrap.com/docs/5.0/examples/dashboard-rtl/">
<link href="https://fonts.googleapis.com/css?family=Open%20Sans:300,400,400italic,600,600italic,700,700italic&subset=latin,latin-ext" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/select2#4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<!-- Bootstrap core CSS -->
<link href="{{ asset('assets/dist/css/bootstrap.rtl.min.css') }}" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,400italic,700,700italic,900,900italic&subset=latin,latin-ext" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open%20Sans:300,400,400italic,600,600italic,700,700italic&subset=latin,latin-ext" rel="stylesheet">
<link href="{{ asset('assets/dist/css/dashboard.rtl.css') }}" rel="stylesheet">
<link href="{{ asset('assets/dist/css/font-awesome.min.css') }}" rel="stylesheet">
#livewireStyles
and script tags are
<script src="{{ asset('assets/dist/js/bootstrap.bundle.min.js') }}"></script>
<!-- Scripts -->
<script src="{{ mix('js/app.js') }}" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.24.1/feather.min.js" integrity="sha384-EbSscX4STvYAC/DxHse8z5gEDaNiKAIGW+EpfzYTfQrgIlHywXXrM9SUIZ0BlyfF" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js" integrity="sha384-i+dHPTzZw7YVZOx9lbH5l6lP74sLRtMtwN2XjVqjf3uAGAREAF4LMIUDTWEVs4LI" crossorigin="anonymous"></script><script src="dashboard.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAkeLMlsiwzp6b3Gnaxd86lvakimwGA6UA&callback=initMap"></script>
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/select2#4.1.0-rc.0/dist/js/select2.min.js"></script>
#livewireScripts
#stack('scripts')
and my view is
<form class="form-horizontal" wire:submit.prevent="storeServices">
<div class="form-group">
<label class="col-md-4 control-label">اختار العيادة</label><br/>
<div class="col-md-4" wire:ignore>
<select class="selectClinic form-control" name="clinics[]" multiple="multiple">
#foreach($clinics as $clinic)
<option value="{{$clinic->id}}">{{$clinic->name}}</option>
#endforeach
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">اختارالخدمات</label><br/>
<div class="col-md-4" wire:ignore>
<select class="form-control" name="services[]" id="selectServices" multiple="multiple">
#foreach($services as $service)
<option value="{{$service->id}}">{{$service->name}}</option>
#endforeach
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-4">
<button type="submit" class="btn btn-primary">حفظ</button>
</div>
</div>
</form>
the view must not be like this there is no feel for select2 in my laravel view file and do not understand the reason for this i tried alot of things and have the same problem

Laravel SweetAlert not working inside validation fails block

I am using realrashid/sweet-alert version 3.1 with laravel 5.8
the issue is when I am using alert after form success or after validation failed its not working here is my code
public function store(Request $request)
{
$rules = [
'title' => 'required',
'title_desc' => 'required',
'desc' => 'required',
'pic' => 'required',
];
$customMessages = [
'title_desc.required' => 'The Short Description field is required.',
];
$validator = Validator::make($request->all(), $rules, $customMessages);
if ($validator->fails()) {
Alert::error('error', 'Validation Errors');
return back();
}
$update_arr = array(
'title' => "hello",
'description' => "world",
'title_desc' => "hello world",
'added_on' => date("Y-m-d H:i:s")
);
StoriesModel::create($update_arr);
Alert::success('Success', 'Story Created Successfully');
return redirect('admin/stories');
}
in this code I used alert two times and its not working on both conditions
on the other hand
if I am using it like below
public function create()
{
Alert::error('error', 'Validation Errors');
$this->data['title'] = 'Stories';
$this->data['menu'] = 'stories';
return View::make('admin.stories.create', $this->data);
}
Its working fine
Here is my master layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>#yield('title')</title>
<link href="{{ url('assets/admin/css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url('assets/admin/font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<!-- Toastr style -->
<link href="{{ url('assets/admin/css/plugins/toastr/toastr.min.css') }}" rel="stylesheet">
<!-- Gritter -->
<link href="{{ url('assets/admin/js/plugins/gritter/jquery.gritter.css') }}" rel="stylesheet">
<link href="{{ url('assets/admin/css/animate.css') }}" rel="stylesheet">
<link href="{{ url('assets/admin/css/style.css') }}" rel="stylesheet">
#yield('page_css_tags')
#yield('page_custom_css')
</head>
<body>
<div id="wrapper">
#include('layouts.admin.sidebar')
<div id="page-wrapper" class="gray-bg">
#include('layouts.admin.topbar')
#include('layouts.admin.content_header')
#yield('content')
#include('layouts.admin.footer')
</div>
</div>
<!-- Mainly scripts -->
<script src="{{ url('assets/admin/js/jquery-3.1.1.min.js') }}"></script>
<script src="{{ url('assets/admin/js/popper.min.js') }}"></script>
<script src="{{ url('assets/admin/js/bootstrap.js') }}"></script>
<script src="{{ url('assets/admin/js/plugins/metisMenu/jquery.metisMenu.js') }}"></script>
<script src="{{ url('assets/admin/js/plugins/slimscroll/jquery.slimscroll.min.js') }}"></script>
<!-- Flot -->
<script src="{{ url('assets/admin/js/plugins/flot/jquery.flot.js') }}"></script>
<script src="{{ url('assets/admin/js/plugins/flot/jquery.flot.tooltip.min.js') }}"></script>
<script src="{{ url('assets/admin/js/plugins/flot/jquery.flot.spline.js') }}"></script>
<script src="{{ url('assets/admin/js/plugins/flot/jquery.flot.resize.js') }}"></script>
<script src="{{ url('assets/admin/js/plugins/flot/jquery.flot.pie.js') }}"></script>
<!-- Peity -->
<script src="{{ url('assets/admin/js/plugins/peity/jquery.peity.min.js') }}"></script>
<script src="{{ url('assets/admin/js/demo/peity-demo.js') }}"></script>
<!-- Custom and plugin javascript -->
<script src="{{ url('assets/admin/js/inspinia.js') }}"></script>
<script src="{{ url('assets/admin/js/plugins/pace/pace.min.js') }}"></script>
<!-- jQuery UI -->
<script src="{{ url('assets/admin/js/plugins/jquery-ui/jquery-ui.min.js') }}"></script>
<!-- GITTER -->
<script src="{{ url('assets/admin/js/plugins/gritter/jquery.gritter.min.js') }}"></script>
<!-- Sparkline -->
<script src="{{ url('assets/admin/js/plugins/sparkline/jquery.sparkline.min.js') }}"></script>
<!-- Sparkline demo data -->
<script src="{{ url('assets/admin/js/demo/sparkline-demo.js') }}"></script>
<!-- ChartJS-->
<script src="{{ url('assets/admin/js/plugins/chartJs/Chart.min.js') }}"></script>
<!-- Date range use moment.js same as full calendar plugin -->
<script src="{{ url('assets/admin/js/plugins/fullcalendar/moment.min.js') }}"></script>
#yield('page_script_tags')
#yield('page_custom_script')
#include('sweetalert::alert')
</body>
</html>
you can see I have added #include('sweetalert::alert') before body tags ends
and here is the blade that extends the master
#extends("layouts.admin.master")
#section('title')
Butterfly | Stories
#endsection
#section('content_header_title')
Stories
#endsection
#section('page_css_tags')
<link href="{{ url('assets/admin/css/plugins/blueimp/css/blueimp-gallery.min.css') }}" rel="stylesheet">
<link href="{{ url('assets/admin/css/plugins/select2/select2.min.css') }}" rel="stylesheet">
<link href="{{ url('assets/admin/css/plugins/select2/select2-bootstrap4.min.css') }}" rel="stylesheet">
#endsection
#section('content')
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-md-12">
<div class="ibox">
<div class="ibox-title">
<h5>{{ #$record ? "Edit" :'Create New' }} Story</h5>
</div>
<div class="ibox-content">
<form method="post" action="{{url('admin/store_story')}}"
enctype="multipart/form-data" role="form">
#csrf
<div class="form-group">
<select class="select2_demo_1 form-control" id="select_seaction" name="seaction"
required>
<option value="" disabled selected>Select Seaction</option>
<option value="header">Header</option>
<option value="middle">Middle Content</option>
<option value="content">Footer Content</option>
</select>
</div>
<div class="form-group">
<label for="title">Title</label>
<input type="text" placeholder="Enter Title" class="form-control" id="title" autofocus
value="{{ #$record ? $record->title : old('title') }}" name="title" required>
</div>
<div class="form-group">
<label for="title_desc">Short Description</label>
<input type="text" placeholder="Enter Short Description" class="form-control"
id="title_desc" value="{{ #$record ? $record->title_desc : old('title_desc') }}"
name="title_desc" required>
</div>
<div class="form-group">
<label for="desc">Story</label>
<textarea class="form-control" name="desc"
id="desc"
rows="5"
required>{{ (#$record) ? $record->description: old('desc') }}</textarea>
</div>
<label title="Upload image file" for="inputImage" class="btn btn-default">
<input type="file" accept="image/*" name="pic"
id="inputImage" required>
Upload image
</label>
<div class="lightBoxGallery" id="imageUpload_display">
#if(#$record)
<a href="{{asset(#$record->image_path)}}"
title="{{ #$record ? $record->title : old('title') }}" data-gallery="">
<img src="{{asset(#$record->image_path)}}">
</a>
#endif
<!-- The Gallery as lightbox dialog, should be a child element of the document body -->
<div id="blueimp-gallery" class="blueimp-gallery">
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev">‹</a>
<a class="next">›</a>
<a class="close">×</a>
<a class="play-pause"></a>
<ol class="indicator"></ol>
</div>
</div>
<div class="form-group row">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn btn-primary btn-sm" type="submit">Save changes</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
#endsection
#section('page_script_tags')
<script src="{{ url('assets/admin/js/plugins/blueimp/jquery.blueimp-gallery.min.js') }}"></script>
<!-- Select2 -->
<script src="{{ url('assets/admin/js/plugins/select2/select2.full.min.js') }}"></script>
#endsection
#section('page_custom_script')
<script>
$(document).ready(function (event) {
$(".select2_demo_1").select2({
theme: 'bootstrap4',
});
});
</script>
#endsection

Facade\Ignition\Exceptions\ViewException syntax error, unexpected end of file

I added manually the Admin LTE and put it on my theme-asset folder and I imported it like this on my app.blade.php
The stacktrace is showing the end of line of the code. I don't know what's wrong with it. I'm just trying to make it to work and view the admin lte dashboard. Can someone please help me out . I just new to laravel. Hope someone can help me
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
<link rel="apple-touch-icon" href="https://ielev8net.com/theme-assets/images/logo/ielev8net_logo.png">
<link rel="shortcut icon" type="image/x-icon" href="https://ielev8net.com/theme-assets/images/logo/ielev8net_logo.png">
<link rel="stylesheet" href="{{ asset('theme-assets/bower_components/bootstrap/dist/css/bootstrap.min.css') }}">
<!-- Font Awesome -->
<link rel="stylesheet" href="{{ asset('theme-assets/bower_components/font-awesome/css/font-awesome.min.css') }}">
<!-- Ionicons -->
<link rel="stylesheet" href="{{ asset('theme-assets/bower_components/Ionicons/css/ionicons.min.css') }}">
<!-- Theme style -->
<link rel="stylesheet" href="{{ asset('theme-assets/dist/css/AdminLTE.min.css') }}">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="{{ asset('theme-assets/dist/css/skins/_all-skins.min.css') }}">
<!-- Morris chart -->
<link rel="stylesheet" href="{{ asset('theme-assets/bower_components/morris.js/morris.css')}}">
<!-- jvectormap -->
<link rel="stylesheet" href="{{ asset('theme-assets/bower_components/jvectormap/jquery-jvectormap.css') }}">
<!-- Date Picker -->
<link rel="stylesheet" href="{{ asset('theme-assets/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') }}">
<!-- Daterange picker -->
<link rel="stylesheet" href="{{ asset('theme-assets/bower_components/bootstrap-daterangepicker/daterangepicker.css') }}">
<!-- bootstrap wysihtml5 - text editor -->
<link rel="stylesheet" href="{{ asset('theme-assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') }}">
<!-- END Page Level CSS-->
<!-- jQuery 3 -->
<script src="{{ asset('theme-assets/bower_components/jquery/dist/jquery.min.js') }}" type="text/javascript"></script>
<!-- jQuery UI 1.11.4 -->
<script src="{{ asset('theme-assets/bower_components/jquery-ui/jquery-ui.min.js') }}" type="text/javascript"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
$.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->
<script src="{{ asset('theme-assets/bower_components/bootstrap/dist/js/bootstrap.min.js') }}" type="text/javascript"></script>
<!-- Morris.js charts -->
<script src="{{ asset('theme-assets/bower_components/raphael/raphael.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('theme-assets/bower_components/morris.js/morris.min.js') }}" type="text/javascript"></script>
<!-- Sparkline -->
<script src="{{ asset('theme-assets/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js') }}" type="text/javascript"></script>
<!-- jvectormap -->
<script src="{{ asset('theme-assets/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('theme-assets/plugins/jvectormap/jquery-jvectormap-world-mill-en.js') }}" type="text/javascript"></script>
<!-- jQuery Knob Chart -->
<script src="{{ asset('theme-assets/bower_components/jquery-knob/dist/jquery.knob.min.js') }}" type="text/javascript"></script>
<!-- daterangepicker -->
<script src="{{ asset('theme-assets/bower_components/moment/min/moment.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('theme-assets/bower_components/bootstrap-daterangepicker/daterangepicker.js') }}" type="text/javascript"></script>
<!-- datepicker -->
<script src="{{ asset('theme-assets/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') }}" type="text/javascript"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="{{ asset('theme-assets/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js') }}" type="text/javascript"></script>
<!-- Slimscroll -->
<script src="{{ asset('theme-assets/bower_components/jquery-slimscroll/jquery.slimscroll.min.js') }}" type="text/javascript"></script>
<!-- FastClick -->
<script src="{{ asset('theme-assets/bower_components/fastclick/lib/fastclick.js') }}" type="text/javascript"></script>
<!-- AdminLTE App -->
<script src="{{ asset('theme-assets/dist/js/adminlte.min.js') }}" type="text/javascript"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="{{ asset('theme-assets/dist/js/pages/dashboard.js') }} " type="text/javascript"></script>
<!-- AdminLTE for demo purposes -->
<script src="{{ asset('theme-assets/dist/js/demo.js') }}" type="text/javascript"></script>
<!-- END PAGE LEVEL JS-->

Injecting jquery code from child and jquery include in parent [Blade - Laravel]

im using laravel and blade for templates. I have a problem, i have a base template called (base.blade.php), where i include all js files (jQuery too).
The problem comes when im child template (myadpack.blade.php extends from base.blade.php). I want to use jQuery in child, but it seems to be impossible, i can do normal js calls, but not using jQuery (that is included in parent). I paste these files here:
base.blade.php
<!DOCTYPE HTML>
<html>
<head>
<title>Tonhits</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{{ asset('css/font-awesome.min.css') }}" />
<link rel="stylesheet" href="{{ asset('css/bootstrap-theme.css') }}" />
<link rel="stylesheet" href="{{ asset('css/main.css') }}" />
<link rel="stylesheet" href="{{ asset('css/table.css') }}" />
<link rel="stylesheet" href="{{ asset('css/tablesaw.css') }}" />
<link rel="stylesheet" href="{{ asset('http://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css') }}" />
#section('css')
#show
</head>
<body class="no-sidebar">
<div id="page-wrapper">
<!-- Header Wrapper -->
<div id="header-wrapper">
<!-- Header -->
<div id="header" class="container">
<!-- Logo -->
<h1><a id="logo">Tonhits</a></h1>
<!-- Nav -->
#include('nav/nav_anon')
</div>
</div>
<!-- Main Wrapper -->
<div id="main-wrapper">
<!-- Main -->
<div id="page" class="container">
<!-- Main Heading -->
<div class="title-heading">
<h2>#yield('titleBig')</h2>
<p> #yield('titleSmall')</p>
</div>
<!-- Main Content -->
<div id="main">
<div class="row">
<div id="content" class="12u">
<!-- <header>
<h2>Nunc fringilla dis natoque amet gravida turpis</h2>
</header> -->
#section('content')
#show
</div>
</div>
</div>
<!-- Main Content -->
</div>
<!-- Main -->
</div>
<!-- Copyright -->
<div id="copyright">
Tonhits. All rights reserved
</div>
</div>
<!-- Scripts -->
<script src="{{ asset('js/jquery.min.js') }}"></script>
<script src="{{ asset('js/jquery.dropotron.min.js') }}"></script>
<script src="{{ asset('js/skel.min.js') }}"></script>
<script src="{{ asset('js/util.js') }}"></script>
<script src="{{ asset('js/main.js') }}"></script>
<script src="{{ asset('js/tablesaw.js') }}"></script>
<script src="{{ asset('http://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js') }}"></script>
#yield('js')
</body>
</html>
myadpack.blade.php
#extends('base')
#section('titleBig', 'Me')
#section('titleSmall', 'My adpack overwiev')
</script>
#section('js')
<script type="text/javascript" >
$(document).on('ready', function(){
alert("a");
});
</script>
#endsection
#section('content')
Here you can see your purchased adpacks, so you can have a detailed tracing.
<table id="adpacks">
<tr>
<th>Test</th>
<th>Test</th>
</tr>
<tr>
<td>Data</td>
<td>Data 2</td>
</tr>
</table>
#endsection
In parent i tried with yield, section, and nothing.
What it could be?
Thank you for reading me.
base.blade.php
<!DOCTYPE HTML>
<html>
<head>
<title>Tonhits</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{{ asset('css/font-awesome.min.css') }}" />
<link rel="stylesheet" href="{{ asset('css/bootstrap-theme.css') }}" />
<link rel="stylesheet" href="{{ asset('css/main.css') }}" />
<link rel="stylesheet" href="{{ asset('css/table.css') }}" />
<link rel="stylesheet" href="{{ asset('css/tablesaw.css') }}" />
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css" />
#yield('css')
</head>
<body class="no-sidebar">
<div id="page-wrapper">
<!-- Header Wrapper -->
<div id="header-wrapper">
<!-- Header -->
<div id="header" class="container">
<!-- Logo -->
<h1><a id="logo">Tonhits</a></h1>
<!-- Nav -->
#include('nav/nav_anon')
</div>
</div>
<!-- Main Wrapper -->
<div id="main-wrapper">
<!-- Main -->
<div id="page" class="container">
<!-- Main Heading -->
<div class="title-heading">
<h2>#yield('titleBig')</h2>
<p> #yield('titleSmall')</p>
</div>
<!-- Main Content -->
<div id="main">
<div class="row">
<div id="content" class="12u">
<!-- <header>
<h2>Nunc fringilla dis natoque amet gravida turpis</h2>
</header> -->
#yield('content')
</div>
</div>
</div>
<!-- Main Content -->
</div>
<!-- Main -->
</div>
<!-- Copyright -->
<div id="copyright">
Tonhits. All rights reserved
</div>
</div>
<!-- Scripts -->
<script src="{{ asset('js/jquery.min.js') }}"></script>
<script src="{{ asset('js/jquery.dropotron.min.js') }}"></script>
<script src="{{ asset('js/skel.min.js') }}"></script>
<script src="{{ asset('js/util.js') }}"></script>
<script src="{{ asset('js/main.js') }}"></script>
<script src="{{ asset('js/tablesaw.js') }}"></script>
<script src="http://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js"></script>
#yield('js')
</body>
</html>
myadpack.blade.php
#extends('base')
#section('titleBig', 'Me')
#section('titleSmall', 'My adpack overwiev')
#section('content')
Here you can see your purchased adpacks, so you can have a detailed tracing.
<table id="adpacks">
<tr>
<th>Test</th>
<th>Test</th>
</tr>
<tr>
<td>Data</td>
<td>Data 2</td>
</tr>
</table>
#endsection
#section('js')
<script type="text/javascript">
$(document).on('ready', function() {
alert("a");
});
</script>
#endsection

Categories