Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
83bdea458f | |||
f32c29fa8c | |||
b9a3cd5647 | |||
12496101e1 | |||
01e77cb807 | |||
b5c8e41e78 | |||
a69049c4ff | |||
fd3487f9b0 | |||
4b541857d7 | |||
4e9bdca2f5 | |||
e0333e352a | |||
f44d780e19 |
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "laravel/leenooks",
|
"name": "leenooks/laravel",
|
||||||
"description": "Leenooks standard templates and tools.",
|
"description": "Leenooks standard templates and tools.",
|
||||||
"keywords": ["laravel","leenooks"],
|
"keywords": ["laravel","leenooks"],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -10,8 +10,6 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"creativeorange/gravatar": "^1.0",
|
|
||||||
"orchestra/asset": "^6.0"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
},
|
},
|
||||||
@@ -26,8 +24,6 @@
|
|||||||
"extra": {
|
"extra": {
|
||||||
"laravel": {
|
"laravel": {
|
||||||
"providers": [
|
"providers": [
|
||||||
"Orchestra\\Asset\\AssetServiceProvider",
|
|
||||||
"Collective\\Html\\HtmlServiceProvider",
|
|
||||||
"Leenooks\\Providers\\LeenooksServiceProvider",
|
"Leenooks\\Providers\\LeenooksServiceProvider",
|
||||||
"Leenooks\\Providers\\CustomBladeServiceProvider"
|
"Leenooks\\Providers\\CustomBladeServiceProvider"
|
||||||
]
|
]
|
||||||
|
11
resources/components/button/cancel.blade.php
Normal file
11
resources/components/button/cancel.blade.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<button type="cancel" id="cancel" style="margin-top: 2.0rem !important;" {{ $attributes->class(['btn','btn-sm','btn-danger']) }}>Cancel</button>
|
||||||
|
|
||||||
|
@section('page-scripts')
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#cancel').on('click',function(item) {
|
||||||
|
return history.back();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@append
|
1
resources/components/button/reset.blade.php
Normal file
1
resources/components/button/reset.blade.php
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<button type="reset" id="reset" style="margin-top: 2.0rem !important;" {{ $attributes->class(['btn','btn-sm','btn-secondary']) }}>Reset</button>
|
1
resources/components/button/submit.blade.php
Normal file
1
resources/components/button/submit.blade.php
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<button type="submit" id="submit" style="margin-top: 2.0rem !important;" {{ $attributes->class(['btn','btn-sm','btn-success']) }}>{{ $slot }}</button>
|
1
resources/components/button/success.blade.php
Normal file
1
resources/components/button/success.blade.php
Normal file
@@ -0,0 +1 @@
|
|||||||
|
@session('success')<button {{ $attributes->class(['btn','btn-sm','btn-success']) }}>{{ $value }}</button>@endsession
|
23
resources/components/form/base.blade.php
Normal file
23
resources/components/form/base.blade.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
@if(isset($label))
|
||||||
|
<label for="{{ $id ?? $name }}">{{ $label }}</label>
|
||||||
|
@endisset
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group has-validation">
|
||||||
|
@if(isset($icon) || isset($prepend))
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">@isset($icon)<i class="fas fa-fw {{ $icon }}"></i>@endisset @isset($prepend){!! $prepend !!}@endisset</span>
|
||||||
|
</div>
|
||||||
|
@endif()
|
||||||
|
{{ $slot }}
|
||||||
|
<span class="invalid-feedback" role="alert">
|
||||||
|
@error($name)
|
||||||
|
{{ $message }}
|
||||||
|
@elseif(isset($feedback))
|
||||||
|
{{ $feedback }}
|
||||||
|
@enderror
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
@isset($helper)
|
||||||
|
<span class="input-helper">{{ $helper }}</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
3
resources/components/form/date.blade.php
Normal file
3
resources/components/form/date.blade.php
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<x-leenooks::form.base {{ $attributes }}>
|
||||||
|
<input type="date" class="form-control {{ $classes ?? ''}}@error($name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" value="{{ old($name,$value ?? '') }}" @readonly(isset($readonly)) @required(isset($required))>
|
||||||
|
</x-leenooks::form.base>
|
3
resources/components/form/email.blade.php
Normal file
3
resources/components/form/email.blade.php
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<x-leenooks::form.base {{ $attributes }}>
|
||||||
|
<input type="email" class="form-control {{ $classes ?? ''}}@error($name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" value="{{ old($name,$value ?? '') }}">
|
||||||
|
</x-leenooks::form.base>
|
17
resources/components/form/file.blade.php
Normal file
17
resources/components/form/file.blade.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<x-leenooks::form.base {{ $attributes }}>
|
||||||
|
<input type="file" class="form-control {{ $classes ?? ''}}@error($name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" @readonly(isset($readonly)) @required(isset($required))>
|
||||||
|
</x-leenooks::form.base>
|
||||||
|
{{ $slot }}
|
||||||
|
|
||||||
|
@section('page-scripts')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#{{ $id ?? $name }}').on('change',function(){
|
||||||
|
//get the file name
|
||||||
|
var fileName = $(this).val();
|
||||||
|
//replace the "Choose a file" label
|
||||||
|
$(this).parent().next('.input-helper').html(fileName);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@append
|
3
resources/components/form/password.blade.php
Normal file
3
resources/components/form/password.blade.php
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<x-leenooks::form.base {{ $attributes }}>
|
||||||
|
<input type="password" class="form-control {{ $classes ?? ''}}@error($name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" value="{{ old($name,$value ?? '') }}">
|
||||||
|
</x-leenooks::form.base>
|
42
resources/components/form/select.blade.php
Normal file
42
resources/components/form/select.blade.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<x-leenooks::form.base {{ $attributes }}>
|
||||||
|
<select class="form-control @error($name) is-invalid @enderror" id="{{ $id }}" name="{{ $name }}">
|
||||||
|
@if(isset($addvalues) && $addvalues)
|
||||||
|
<option id="new"></option>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@empty($groupby)
|
||||||
|
@foreach($options as $option)
|
||||||
|
@continue(! Arr::get($option,'value'))
|
||||||
|
<option value="{{ Arr::get($option,'id') }}" @selected(Arr::get($option,'id') == old($name,$value ?? ''))>{{ Arr::get($option,'value') }}</option>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
@foreach($options->groupBy($groupby) as $group)
|
||||||
|
<optgroup label="{{ $groupby == 'active' ? (Arr::get($group->first(),$groupby) ? 'Active' : 'Not Active') : Arr::get($group->first(),$groupby) }}">
|
||||||
|
@foreach($group as $option)
|
||||||
|
@continue(! Arr::get($option,'value'))
|
||||||
|
<option value="{{ Arr::get($option,'id') }}" @selected(Arr::get($option,'id') == old($old,$value ?? ''))>{{ Arr::get($option,'value') }}</option>
|
||||||
|
@endforeach
|
||||||
|
</optgroup>
|
||||||
|
@endforeach
|
||||||
|
@endempty
|
||||||
|
</select>
|
||||||
|
</x-leenooks::form.base>
|
||||||
|
|
||||||
|
@section('page-scripts')
|
||||||
|
@css(select2)
|
||||||
|
@js(select2,autofocus)
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#{{ $id }}').select2({
|
||||||
|
dropdownAutoWidth: true,
|
||||||
|
width: 'style',
|
||||||
|
@isset($addvalues)
|
||||||
|
tags: true,
|
||||||
|
placeholder: '',
|
||||||
|
allowClear: true,
|
||||||
|
@endisset
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@append
|
3
resources/components/form/text.blade.php
Normal file
3
resources/components/form/text.blade.php
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<x-leenooks::form.base {{ $attributes }}>
|
||||||
|
<input type="text" class="form-control {{ $classes ?? ''}}@error($name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" value="{{ old($name,$value ?? '') }}" @readonly(isset($readonly)) @required(isset($required))>
|
||||||
|
</x-leenooks::form.base>
|
3
resources/components/form/textarea.blade.php
Normal file
3
resources/components/form/textarea.blade.php
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<x-leenooks::form.base {{ $attributes }}>
|
||||||
|
<textarea class="form-control {{ $classes ?? ''}} @error($name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" @isset($placeholder)placeholder="{{ $placeholder }}"@endisset>{{ old($name,$value ?? '') }}</textarea>
|
||||||
|
</x-leenooks::form.base>
|
17
resources/components/form/toggle.blade.php
Normal file
17
resources/components/form/toggle.blade.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group has-validation">
|
||||||
|
<div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
|
||||||
|
<input type="checkbox" class="custom-control-input @error($name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" @checked(old($name,$value ?? ''))>
|
||||||
|
@if(isset($label))
|
||||||
|
<label class="custom-control-label" for="{{ $id ?? $name }}">{{ $label }}</label>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<span class="invalid-feedback" role="alert">
|
||||||
|
@error($name)
|
||||||
|
{{ $message }}
|
||||||
|
@elseif(isset($feedback))
|
||||||
|
{{ $feedback }}
|
||||||
|
@enderror
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
@@ -76,11 +76,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- /.col -->
|
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<button type="submit" name="submit" class="btn btn-primary mr-0 float-right">Sign In</button>
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<button type="submit" name="submit" class="btn btn-sm btn-primary float-right">Sign In</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.col -->
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 pt-2">
|
||||||
|
<button type="button" id="passkey" class="btn btn-sm btn-primary float-right"><i class="bi bi-key"></i> Passkey</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@@ -103,3 +112,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- /.login-box -->
|
<!-- /.login-box -->
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@section('page-scripts')
|
||||||
|
<!-- Passkeys -->
|
||||||
|
<script type='text/javascript' src='{{ asset('/passkey/passkey.js') }}'></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#passkey').on('click',function() {
|
||||||
|
passkey_check('{{ csrf_token() }}','/passkey/loggedin');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@append
|
@@ -39,9 +39,6 @@
|
|||||||
@section('scripts')
|
@section('scripts')
|
||||||
@include('adminlte::layouts.partials.scripts')
|
@include('adminlte::layouts.partials.scripts')
|
||||||
|
|
||||||
{{-- Scripts --}}
|
|
||||||
{!! Asset::scripts() !!}
|
|
||||||
|
|
||||||
@yield('page-scripts')
|
@yield('page-scripts')
|
||||||
@show
|
@show
|
||||||
</body>
|
</body>
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@yield('page-scripts')
|
||||||
@show
|
@show
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@@ -41,9 +41,6 @@
|
|||||||
<![endif]-->
|
<![endif]-->
|
||||||
--}}
|
--}}
|
||||||
|
|
||||||
<!-- STYLESHEETS -->
|
|
||||||
{!! Asset::styles() !!}
|
|
||||||
|
|
||||||
@yield('page-styles')
|
@yield('page-styles')
|
||||||
|
|
||||||
@if(file_exists('css/fixes.css'))
|
@if(file_exists('css/fixes.css'))
|
||||||
|
@@ -89,6 +89,18 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('body')
|
||||||
|
.addClass('sidebar-collapse')
|
||||||
|
.delay(500)
|
||||||
|
.queue(function () {
|
||||||
|
window.dispatchEvent(new Event('resize'));
|
||||||
|
$(this).dequeue();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
@if(file_exists('js/custom.js'))
|
@if(file_exists('js/custom.js'))
|
||||||
<!-- Any Custom JS -->
|
<!-- Any Custom JS -->
|
||||||
<script src="{{ asset('js/custom.js') }}"></script>
|
<script src="{{ asset('js/custom.js') }}"></script>
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||||
<div class="image">
|
<div class="image">
|
||||||
@if(isset($user) AND $user->exists)
|
@if(isset($user) AND $user->exists)
|
||||||
<img src="{{ Gravatar::get(($user->exists AND $user->email) ? $user->email : 'nobody@example.com') }}" class="img-circle elevation-2" alt="User">
|
<i class="fa fa-fw fa-2x fa-user text-white"></i>
|
||||||
@else
|
@else
|
||||||
<a name="login" href="{{ url()->current().'?login=1' }}" class="d-block"><i class="pl-1 fas fa-lock fa-2x"></i></a>
|
<a name="login" href="{{ url()->current().'?login=1' }}" class="d-block"><i class="pl-1 fas fa-lock fa-2x"></i></a>
|
||||||
@endif
|
@endif
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<label for="{{ $id }}">{{ $label }}</label>
|
|
||||||
<div class="input-group has-validation">
|
|
||||||
@empty($icon)
|
|
||||||
@else
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
|
|
||||||
</div>
|
|
||||||
@endempty()
|
|
||||||
<input type="date" class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}" value="{{ old($old,$value) }}">
|
|
||||||
<span class="invalid-feedback" role="alert">
|
|
||||||
@error($id)
|
|
||||||
{{ $message }}
|
|
||||||
@enderror
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@@ -1,39 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<label for="{{ $id }}">{{ $label }}</label>
|
|
||||||
<div class="input-group has-validation">
|
|
||||||
@empty($icon)
|
|
||||||
@else
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
|
|
||||||
</div>
|
|
||||||
@endempty()
|
|
||||||
<div class="custom-file">
|
|
||||||
<input type="file" class="custom-file-input @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}">
|
|
||||||
<label class="custom-file-label input-group-text" for="{{ $id }}">Choose file</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{--
|
|
||||||
<div class="input-group-append">
|
|
||||||
<button type="submit" class="input-group-text btn btn-success" id="">Upload</button>
|
|
||||||
</div>
|
|
||||||
--}}
|
|
||||||
<span class="invalid-feedback @error($id) d-block @enderror" role="alert">
|
|
||||||
@error($id)
|
|
||||||
{{ $message }}
|
|
||||||
@enderror
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@section('page-scripts')
|
|
||||||
<script>
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('#{{ $id }}').on('change',function(){
|
|
||||||
//get the file name
|
|
||||||
var fileName = $(this).val();
|
|
||||||
//replace the "Choose a file" label
|
|
||||||
$(this).next('.custom-file-label').html(fileName);
|
|
||||||
})
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@append
|
|
@@ -1,57 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<label for="{{ $id }}">{{ $label }}</label>
|
|
||||||
<div class="input-group has-validation">
|
|
||||||
@empty($icon)
|
|
||||||
@else
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
|
|
||||||
</div>
|
|
||||||
@endempty()
|
|
||||||
|
|
||||||
<select class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}">
|
|
||||||
@if(! isset($addvalues) || ! $addvalues)
|
|
||||||
<option id="new"></option>
|
|
||||||
@endif
|
|
||||||
@empty($groupby)
|
|
||||||
@foreach($options as $option)
|
|
||||||
@empty(Arr::get($option,'value')) @continue @endempty
|
|
||||||
<option value="{{ Arr::get($option,'id') }}" @if(Arr::get($option,'id') == old($old,$value))selected @endif>{{ Arr::get($option,'value') }}</option>
|
|
||||||
@endforeach
|
|
||||||
@else
|
|
||||||
@foreach($options->groupBy($groupby) as $group)
|
|
||||||
<optgroup label="{{ $groupby == 'active' ? (Arr::get($group->first(),$groupby) ? 'Active' : 'Not Active') : Arr::get($group->first(),$groupby) }}">
|
|
||||||
@foreach($group as $option)
|
|
||||||
@empty(Arr::get($option,'value')) @continue @endempty
|
|
||||||
<option value="{{ Arr::get($option,'id') }}" @if(Arr::get($option,'id') == old($old,$value))selected @endif>{{ Arr::get($option,'value') }}</option>
|
|
||||||
@endforeach
|
|
||||||
</optgroup>
|
|
||||||
@endforeach
|
|
||||||
@endempty
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<span class="invalid-feedback" role="alert">
|
|
||||||
@error($id)
|
|
||||||
{{ $message }}
|
|
||||||
@enderror
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@section('page-scripts')
|
|
||||||
@css(select2)
|
|
||||||
@js(select2,autofocus)
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('#{{ $id }}').select2({
|
|
||||||
dropdownAutoWidth: true,
|
|
||||||
width: 'style',
|
|
||||||
@isset($addvalues)
|
|
||||||
tags: true,
|
|
||||||
placeholder: '',
|
|
||||||
allowClear: true,
|
|
||||||
@endisset
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@append
|
|
@@ -1,17 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<label for="{{ $id }}">{{ $label }}</label>
|
|
||||||
<div class="input-group has-validation">
|
|
||||||
@empty($icon)
|
|
||||||
@else
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
|
|
||||||
</div>
|
|
||||||
@endempty()
|
|
||||||
<input type="text" class="form-control {{ $classes ?? ''}}@error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?: $id }}" value="{{ old($old ?? $name,$value) }}">
|
|
||||||
<span class="invalid-feedback" role="alert">
|
|
||||||
@error($id)
|
|
||||||
{{ $message }}
|
|
||||||
@enderror
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@@ -1,11 +0,0 @@
|
|||||||
<div class="form-group">
|
|
||||||
<div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
|
|
||||||
<input type="checkbox" class="custom-control-input" id="{{ $id }}" name="{{ $name ?: $id }}" {{ old($old ?? $name,$value) ? 'checked' : '' }}>
|
|
||||||
<label class="custom-control-label" for="{{ $id }}">{{ $label }}</label>
|
|
||||||
</div>
|
|
||||||
<span class="invalid-feedback @error($id) d-block @enderror" role="alert">
|
|
||||||
@error($id)
|
|
||||||
{{ $message }}
|
|
||||||
@enderror
|
|
||||||
</span>
|
|
||||||
</div>
|
|
@@ -1 +0,0 @@
|
|||||||
@if(session()->has('success'))<span class="ml-3 pt-0 pb-0 pr-1 pl-1 btn btn-outline-success float-right"><small>{{ session()->get('success') }}</small></span>@endif
|
|
@@ -38,9 +38,6 @@
|
|||||||
@section('scripts')
|
@section('scripts')
|
||||||
@include('architect::layouts.partials.scripts')
|
@include('architect::layouts.partials.scripts')
|
||||||
|
|
||||||
{{-- Scripts --}}
|
|
||||||
{!! Asset::scripts() !!}
|
|
||||||
|
|
||||||
@yield('page-scripts')
|
@yield('page-scripts')
|
||||||
@show
|
@show
|
||||||
</body>
|
</body>
|
||||||
|
@@ -12,9 +12,6 @@
|
|||||||
@section('scripts')
|
@section('scripts')
|
||||||
@include('architect::auth.partials.scripts')
|
@include('architect::auth.partials.scripts')
|
||||||
|
|
||||||
{{-- Scripts --}}
|
|
||||||
{!! Asset::scripts() !!}
|
|
||||||
|
|
||||||
@yield('page-scripts')
|
@yield('page-scripts')
|
||||||
@show
|
@show
|
||||||
</body>
|
</body>
|
||||||
|
@@ -35,9 +35,6 @@
|
|||||||
<link rel="stylesheet" href="{{ asset('/css/print.css') }}">
|
<link rel="stylesheet" href="{{ asset('/css/print.css') }}">
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<!-- STYLESHEETS -->
|
|
||||||
{!! Asset::styles() !!}
|
|
||||||
|
|
||||||
<!-- Theme style -->
|
<!-- Theme style -->
|
||||||
<link rel="stylesheet" href="{{ asset('/css/architect.min.css') }}">
|
<link rel="stylesheet" href="{{ asset('/css/architect.min.css') }}">
|
||||||
|
|
||||||
|
@@ -38,9 +38,6 @@
|
|||||||
@section('scripts')
|
@section('scripts')
|
||||||
@include('metronic::layouts.partials.scripts')
|
@include('metronic::layouts.partials.scripts')
|
||||||
|
|
||||||
{{-- Scripts --}}
|
|
||||||
{!! Asset::scripts() !!}
|
|
||||||
|
|
||||||
@yield('page-scripts')
|
@yield('page-scripts')
|
||||||
@show
|
@show
|
||||||
</body>
|
</body>
|
||||||
|
@@ -14,10 +14,10 @@
|
|||||||
--}}
|
--}}
|
||||||
|
|
||||||
<!-- Theme style -->
|
<!-- Theme style -->
|
||||||
@themecss('/css/components.css','components-css')
|
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/components.css') }}">
|
||||||
@themecss('/css/style.css','style-css')
|
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/style.css') }}">
|
||||||
@themecss('/css/style-responsive.css','style-responsive-css')
|
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/style-responsive.css') }}">
|
||||||
@themecss('/css/themes/blue.css','theme-blue-css')
|
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/themes/blue.css') }}">
|
||||||
|
|
||||||
<!-- Google Font: Source Sans Pro -->
|
<!-- Google Font: Source Sans Pro -->
|
||||||
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|PT+Sans+Narrow|Source+Sans+Pro:200,300,400,600,700,900&subset=all" rel="stylesheet" type="text/css">
|
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|PT+Sans+Narrow|Source+Sans+Pro:200,300,400,600,700,900&subset=all" rel="stylesheet" type="text/css">
|
||||||
@@ -32,10 +32,7 @@
|
|||||||
<link rel="shortcut icon" href="{{ object_get($site,'favicon','favicon.ico') }}" />
|
<link rel="shortcut icon" href="{{ object_get($site,'favicon','favicon.ico') }}" />
|
||||||
|
|
||||||
<!-- Custom CSS -->
|
<!-- Custom CSS -->
|
||||||
@php(Asset::add('custom-css','/css/custom.css'))
|
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/custom.css') }}">
|
||||||
|
|
||||||
<!-- STYLESHEETS -->
|
|
||||||
{!! Asset::styles() !!}
|
|
||||||
|
|
||||||
@yield('page-styles')
|
@yield('page-styles')
|
||||||
</head>
|
</head>
|
@@ -18,5 +18,5 @@
|
|||||||
|
|
||||||
@if(file_exists('js/custom.js'))
|
@if(file_exists('js/custom.js'))
|
||||||
<!-- Any Custom JS -->
|
<!-- Any Custom JS -->
|
||||||
<script src="{{ asset('js/custom.js') }}"></script>
|
<script type="text/javascript" src="{{ asset('js/custom.js') }}"></script>
|
||||||
@endif
|
@endif
|
@@ -13,7 +13,7 @@ class Carbon extends CarbonBase
|
|||||||
{
|
{
|
||||||
const MONTHS_PER_HALF = 6;
|
const MONTHS_PER_HALF = 6;
|
||||||
|
|
||||||
public function __get($name)
|
public function __get(string $name): mixed
|
||||||
{
|
{
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
case 'half':
|
case 'half':
|
||||||
@@ -57,7 +57,7 @@ class Carbon extends CarbonBase
|
|||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function startOfHalf($dayOfWeek = null)
|
public function startOfHalf(int $dayOfWeek=NULL)
|
||||||
{
|
{
|
||||||
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF - 5, 1)->firstOfMonth($dayOfWeek);
|
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF - 5, 1)->firstOfMonth($dayOfWeek);
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ class Carbon extends CarbonBase
|
|||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function endOfHalf($dayOfWeek = null)
|
public function endOfHalf(int $dayOfWeek=NULL)
|
||||||
{
|
{
|
||||||
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek);
|
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek);
|
||||||
}
|
}
|
||||||
|
29
src/Casts/LeenooksCarbon.php
Normal file
29
src/Casts/LeenooksCarbon.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Leenooks\Casts;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class LeenooksCarbon implements CastsAttributes
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Cast the given value.
|
||||||
|
*
|
||||||
|
* @param array<string, mixed> $attributes
|
||||||
|
*/
|
||||||
|
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
|
||||||
|
{
|
||||||
|
return \Leenooks\Carbon::create($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare the given value for storage.
|
||||||
|
*
|
||||||
|
* @param array<string, mixed> $attributes
|
||||||
|
*/
|
||||||
|
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
|
||||||
|
{
|
||||||
|
return $value->format('Y-m-d H:i:s');
|
||||||
|
}
|
||||||
|
}
|
@@ -3,7 +3,6 @@
|
|||||||
namespace Leenooks\Controllers;
|
namespace Leenooks\Controllers;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Providers\RouteServiceProvider;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
use Session;
|
use Session;
|
||||||
@@ -57,6 +56,6 @@ class SwitchUserController extends Controller
|
|||||||
if ($user = Session::pull('orig_user'))
|
if ($user = Session::pull('orig_user'))
|
||||||
Auth::login($user);
|
Auth::login($user);
|
||||||
|
|
||||||
return Redirect::to(RouteServiceProvider::HOME);
|
return Redirect::to('/home');
|
||||||
}
|
}
|
||||||
}
|
}
|
26
src/Http/Middleware/ActiveUser.php
Normal file
26
src/Http/Middleware/ActiveUser.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Leenooks\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
class ActiveUser
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param Request $request
|
||||||
|
* @param \Closure $next
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle(Request $request,\Closure $next)
|
||||||
|
{
|
||||||
|
if ((! Auth::user()?->exists) || (! Auth::user()->active)) {
|
||||||
|
Auth::logout();
|
||||||
|
abort(403,'Your account is not active');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
@@ -5,7 +5,6 @@ namespace Leenooks\Providers;
|
|||||||
use Illuminate\Support\Facades\Blade;
|
use Illuminate\Support\Facades\Blade;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Orchestra\Support\Facades\Asset;
|
|
||||||
|
|
||||||
class CustomBladeServiceProvider extends ServiceProvider
|
class CustomBladeServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@@ -37,48 +36,49 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
$return = collect();
|
$return = collect();
|
||||||
$urls = collect();
|
$css = collect();
|
||||||
|
$js = collect();
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'datatables':
|
case 'datatables':
|
||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'css':
|
case 'css':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css');
|
$css->put($type,'https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css');
|
||||||
|
|
||||||
foreach ($arguments as $option) {
|
foreach ($arguments as $option) {
|
||||||
$key = $type.':'.$option;
|
$key = $type.':'.$option;
|
||||||
switch ($option) {
|
switch ($option) {
|
||||||
case 'bootstrap4':
|
case 'bootstrap4':
|
||||||
$urls->put($key,'/plugin/dataTables/dataTables.bootstrap4.css');
|
$css->put($key,'/plugin/dataTables/dataTables.bootstrap4.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'buttons':
|
case 'buttons':
|
||||||
$urls->put($key,'https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css');
|
$css->put($key,'https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'fixedheader':
|
case 'fixedheader':
|
||||||
$urls->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/css/fixedHeader.dataTables.min.css');
|
$css->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/css/fixedHeader.dataTables.min.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'rowgroup':
|
case 'rowgroup':
|
||||||
$urls->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/css/rowGroup.dataTables.min.css');
|
$css->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/css/rowGroup.dataTables.min.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'responsive':
|
case 'responsive':
|
||||||
$urls->put($key,'http://cdn.datatables.net/responsive/2.2.6/css/responsive.dataTables.min.css');
|
$css->put($key,'http://cdn.datatables.net/responsive/2.2.6/css/responsive.dataTables.min.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'searchpanes':
|
case 'searchpanes':
|
||||||
$urls->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/css/searchPanes.dataTables.min.css');
|
$css->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/css/searchPanes.dataTables.min.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'searchpanes-left':
|
case 'searchpanes-left':
|
||||||
$urls->put('searchpanes:searchpanes-left','/plugin/dataTables/leftSearchPanes.css');
|
$css->put('searchpanes:searchpanes-left','/plugin/dataTables/leftSearchPanes.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'select':
|
case 'select':
|
||||||
$urls->put($key,'https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css');
|
$css->put($key,'https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -90,40 +90,40 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
case 'js':
|
case 'js':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js');
|
$js->put($type,'https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js');
|
||||||
|
|
||||||
foreach ($arguments as $option) {
|
foreach ($arguments as $option) {
|
||||||
$key = $type.':'.$option;
|
$key = $type.':'.$option;
|
||||||
|
|
||||||
switch ($option) {
|
switch ($option) {
|
||||||
case 'bootstrap4':
|
case 'bootstrap4':
|
||||||
$urls->put($key,'/plugin/dataTables/dataTables.bootstrap4.js');
|
$js->put($key,'/plugin/dataTables/dataTables.bootstrap4.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'buttons':
|
case 'buttons':
|
||||||
$urls->put($key,'https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js');
|
$js->put($key,'https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js');
|
||||||
$urls->put($key.'html5','https://cdn.datatables.net/buttons/1.6.5/js/buttons.html5.min.js');
|
$js->put($key.'html5','https://cdn.datatables.net/buttons/1.6.5/js/buttons.html5.min.js');
|
||||||
$urls->put($key.'jszip','https://cdnjs.cloudflare.com/ajax/libs/jszip/3.2.0/jszip.min.js');
|
$js->put($key.'jszip','https://cdnjs.cloudflare.com/ajax/libs/jszip/3.2.0/jszip.min.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'fixedheader':
|
case 'fixedheader':
|
||||||
$urls->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/js/dataTables.fixedHeader.min.js');
|
$js->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/js/dataTables.fixedHeader.min.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'responsive':
|
case 'responsive':
|
||||||
$urls->put($key,'https://cdn.datatables.net/responsive/2.2.6/js/dataTables.responsive.min.js');
|
$js->put($key,'https://cdn.datatables.net/responsive/2.2.6/js/dataTables.responsive.min.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'rowgroup':
|
case 'rowgroup':
|
||||||
$urls->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js');
|
$js->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'searchpanes':
|
case 'searchpanes':
|
||||||
$urls->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/js/dataTables.searchPanes.min.js');
|
$js->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/js/dataTables.searchPanes.min.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'select':
|
case 'select':
|
||||||
$urls->put($key,'https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js');
|
$js->put($key,'https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -137,11 +137,11 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
case 'datepick':
|
case 'datepick':
|
||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'css':
|
case 'css':
|
||||||
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css');
|
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'js':
|
case 'js':
|
||||||
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js');
|
$js->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -149,7 +149,7 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
case 'debounce':
|
case 'debounce':
|
||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'js':
|
case 'js':
|
||||||
$urls->put($type,'js/debounce.js');
|
$js->put($type,'js/debounce.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -158,49 +158,49 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'js':
|
case 'js':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://code.highcharts.com/highcharts.js');
|
$js->put($type,'https://code.highcharts.com/highcharts.js');
|
||||||
|
|
||||||
foreach ($arguments as $option) {
|
foreach ($arguments as $option) {
|
||||||
$key = $type.':'.$option;
|
$key = $type.':'.$option;
|
||||||
switch ($option) {
|
switch ($option) {
|
||||||
case '3d':
|
case '3d':
|
||||||
$urls->put($key,'https://code.highcharts.com/highcharts-3d.js');
|
$js->put($key,'https://code.highcharts.com/highcharts-3d.js');
|
||||||
$urls->put($key.'mouseover','/plugin/highcharts/3dmouseover.js');
|
$js->put($key.'mouseover','/plugin/highcharts/3dmouseover.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'data':
|
case 'data':
|
||||||
$urls->put($key,'https://code.highcharts.com/modules/data.js');
|
$js->put($key,'https://code.highcharts.com/modules/data.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'defaults':
|
case 'defaults':
|
||||||
$urls->put($key,'/plugin/highcharts/defaults.js');
|
$js->put($key,'/plugin/highcharts/defaults.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'drilldown':
|
case 'drilldown':
|
||||||
$urls->put($key,'https://code.highcharts.com/modules/drilldown.js');
|
$js->put($key,'https://code.highcharts.com/modules/drilldown.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'export':
|
case 'export':
|
||||||
$urls->put($key,'https://code.highcharts.com/modules/exporting.js');
|
$js->put($key,'https://code.highcharts.com/modules/exporting.js');
|
||||||
$urls->put($key.'data','https://code.highcharts.com/modules/export-data.js');
|
$js->put($key.'data','https://code.highcharts.com/modules/export-data.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'funnel':
|
case 'funnel':
|
||||||
$urls->put($key,'https://code.highcharts.com/modules/funnel.js');
|
$js->put($key,'https://code.highcharts.com/modules/funnel.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'heatmap':
|
case 'heatmap':
|
||||||
$urls->put($key,'https://code.highcharts.com/modules/heatmap.js');
|
$js->put($key,'https://code.highcharts.com/modules/heatmap.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'solidguage':
|
case 'solidguage':
|
||||||
$urls->put($key,'https://code.highcharts.com/highcharts-more.js');
|
$js->put($key,'https://code.highcharts.com/highcharts-more.js');
|
||||||
$urls->put($key.'accessiblity','https://code.highcharts.com/modules/accessibility.js');
|
$js->put($key.'accessiblity','https://code.highcharts.com/modules/accessibility.js');
|
||||||
$urls->put($key.'solid-guage','https://code.highcharts.com/modules/solid-gauge.js');
|
$js->put($key.'solid-guage','https://code.highcharts.com/modules/solid-gauge.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'theme-dark':
|
case 'theme-dark':
|
||||||
$urls->put($key,'https://code.highcharts.com/themes/dark-unica.js');
|
$js->put($key,'https://code.highcharts.com/themes/dark-unica.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -215,17 +215,17 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'js':
|
case 'js':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://code.highcharts.com/stock/highstock.js');
|
$js->put($type,'https://code.highcharts.com/stock/highstock.js');
|
||||||
|
|
||||||
foreach ($arguments as $option) {
|
foreach ($arguments as $option) {
|
||||||
$key = $type.':'.$option;
|
$key = $type.':'.$option;
|
||||||
switch ($option) {
|
switch ($option) {
|
||||||
case 'data':
|
case 'data':
|
||||||
$urls->put($key,'https://code.highcharts.com/stock/modules/data.js');
|
$js->put($key,'https://code.highcharts.com/stock/modules/data.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'export':
|
case 'export':
|
||||||
$urls->put($key,'https://code.highcharts.com/stock/modules/exporting.js');
|
$js->put($key,'https://code.highcharts.com/stock/modules/exporting.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -240,19 +240,19 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'css':
|
case 'css':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css');
|
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'js':
|
case 'js':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js');
|
$js->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js');
|
||||||
|
|
||||||
foreach ($arguments as $option) {
|
foreach ($arguments as $option) {
|
||||||
$key = $type.':'.$option;
|
$key = $type.':'.$option;
|
||||||
switch ($option) {
|
switch ($option) {
|
||||||
case 'autofocus':
|
case 'autofocus':
|
||||||
$urls->put($key,'plugin/select2/fix-autofocus.js');
|
$js->put($key,'/plugin/select2/fix-autofocus.js');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -267,13 +267,13 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'css':
|
case 'css':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
|
$css->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'js':
|
case 'js':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js');
|
$js->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -282,13 +282,13 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'css':
|
case 'css':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.css');
|
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.css');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'js':
|
case 'js':
|
||||||
// Base
|
// Base
|
||||||
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.js');
|
$js->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -297,8 +297,8 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
switch ($content) {
|
switch ($content) {
|
||||||
case 'js':
|
case 'js':
|
||||||
// Base
|
// Base
|
||||||
$urls->put('validate','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/jquery.validate.min.js');
|
$js->put('validate','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/jquery.validate.min.js');
|
||||||
$urls->put('validate.additional','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/additional-methods.min.js');
|
$js->put('validate.additional','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/additional-methods.min.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -307,13 +307,12 @@ class CustomBladeServiceProvider extends ServiceProvider
|
|||||||
throw new \Exception(sprintf('Unknown Expression: [%s]',$expression));
|
throw new \Exception(sprintf('Unknown Expression: [%s]',$expression));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($urls->count())
|
if ($js->count())
|
||||||
return $urls->map(function($item,$key) {
|
$return = $return->merge($js->map(fn($item)=>sprintf('<script type="text/javascript" src="%s"></script>',$item)));
|
||||||
$dependancy='';
|
|
||||||
if (str_contains($key,':'))
|
|
||||||
[$dependancy,$key] = explode(':',$key);
|
|
||||||
|
|
||||||
return "<?php Asset::add('$key','$item','$dependancy'); ?>";
|
if ($css->count())
|
||||||
})->join('');
|
$return = $return->merge($css->map(fn($item)=>sprintf('<link rel="stylesheet" href="%s">',$item)));
|
||||||
|
|
||||||
|
return $return->join('');
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
namespace Leenooks\Providers;
|
namespace Leenooks\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Blade;
|
||||||
use Leenooks\Http\Middleware\GuestUser;
|
use Leenooks\Http\Middleware\GuestUser;
|
||||||
use Illuminate\Routing\Router;
|
use Illuminate\Routing\Router;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,7 +15,7 @@ use Illuminate\Support\ServiceProvider;
|
|||||||
*/
|
*/
|
||||||
class LeenooksServiceProvider extends ServiceProvider
|
class LeenooksServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
private $_path = '';
|
private string $_path = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bootstrap the application services.
|
* Bootstrap the application services.
|
||||||
@@ -31,10 +33,12 @@ class LeenooksServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
$this->loadViewsFrom($this->_path.'/resources/themes/metronic/views/', 'metronic');
|
$this->loadViewsFrom($this->_path.'/resources/themes/metronic/views/', 'metronic');
|
||||||
|
|
||||||
// Enable a Collect::recursive() function
|
//Blade::componentNamespace('Leenooks\\Components','leenooks');
|
||||||
\Illuminate\Support\Collection::macro('recursive', function () {
|
Blade::anonymousComponentPath($this->_path.'/resources/components', 'leenooks');
|
||||||
return $this->map(function ($value) {
|
|
||||||
|
|
||||||
|
// Enable a Collect::recursive() function
|
||||||
|
Collection::macro('recursive', function () {
|
||||||
|
return $this->map(function ($value) {
|
||||||
if (is_array($value) || is_object($value)) {
|
if (is_array($value) || is_object($value)) {
|
||||||
return collect($value)->recursive();
|
return collect($value)->recursive();
|
||||||
}
|
}
|
||||||
|
@@ -25,33 +25,90 @@ trait CompositeKeys {
|
|||||||
{
|
{
|
||||||
$keys = $this->getKeyName();
|
$keys = $this->getKeyName();
|
||||||
|
|
||||||
if (! is_array($keys)) {
|
return !is_array($keys)
|
||||||
return parent::setKeysForSaveQuery($query);
|
? parent::setKeysForSaveQuery($query)
|
||||||
|
: $query->where(function($q) use($keys) {
|
||||||
|
foreach ($keys as $key){
|
||||||
|
$q->where($key,$this->getAttribute($key));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
foreach($keys as $keyName) {
|
|
||||||
$query->where($keyName, '=', $this->getKeyForSaveQuery($keyName));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $query;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the primary key value for a save query.
|
* Get the casts array.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getCasts()
|
||||||
|
{
|
||||||
|
if ($this->getIncrementing())
|
||||||
|
return array_merge([$this->getKeyName() => $this->getKeyType()],$this->casts);
|
||||||
|
|
||||||
|
return $this->casts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return false
|
||||||
|
*/
|
||||||
|
public function getIncrementing()
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of the model's primary key.
|
||||||
*
|
*
|
||||||
* @param mixed $keyName
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected function getKeyForSaveQuery($keyName = null)
|
public function getKey()
|
||||||
{
|
{
|
||||||
if (is_null($keyName)) {
|
$fields = $this->getKeyName();
|
||||||
$keyName = $this->getKeyName();
|
$keys = [];
|
||||||
|
|
||||||
|
array_map(function($key) use(&$keys) {
|
||||||
|
$keys[] = $this->getAttribute($key);
|
||||||
|
}, $fields);
|
||||||
|
|
||||||
|
return $keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->original[$keyName])) {
|
/**
|
||||||
return $this->original[$keyName];
|
* Finds model by primary keys
|
||||||
|
*
|
||||||
|
* @param array $ids
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public static function find(array $ids)
|
||||||
|
{
|
||||||
|
$modelClass = get_called_class();
|
||||||
|
$model = new $modelClass();
|
||||||
|
$keys = $model->primaryKey;
|
||||||
|
|
||||||
|
return $model->where(function($query) use($ids,$keys) {
|
||||||
|
foreach ($keys as $idx => $key) {
|
||||||
|
if (isset($ids[$idx]))
|
||||||
|
$query->where($key, $ids[$idx]);
|
||||||
|
else
|
||||||
|
$query->whereNull($key);
|
||||||
|
}
|
||||||
|
})->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->getAttribute($keyName);
|
/**
|
||||||
|
* Find model by primary key or throws ModelNotFoundException
|
||||||
|
*
|
||||||
|
* @param array $ids
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public static function findOrFail(array $ids)
|
||||||
|
{
|
||||||
|
$modelClass = get_called_class();
|
||||||
|
$model = new $modelClass();
|
||||||
|
$record = $model->find($ids);
|
||||||
|
|
||||||
|
if (! $record)
|
||||||
|
throw new ModelNotFoundException;
|
||||||
|
|
||||||
|
return $record;
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user