Skip to content

Commit

Permalink
Batman! (this commit has no parents)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeceM committed May 3, 2019
0 parents commit 45d495b
Show file tree
Hide file tree
Showing 24 changed files with 1,323 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
npm-debug.log
yarn-error.log
54 changes: 54 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "reecem/laravel-settings",
"type": "package",
"description": "YASP A settings package that uses a property bag and caching",
"require": {
"illuminate/support": "^5.6",
"illuminate/filesystem": "^5.6"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"orchestra/testbench": "^3.5"
},
"keywords": [
"laravel",
"settings",
"key-value",
"property-bag"
],
"license": "MIT",
"authors": [
{
"name": "ReeceM",
"email": "reecestevenmay@gmail.com",
"homepage": "https://githib.com/reecem"
}
],
"homepage": "https://github.com/reecem/laravel-settings",
"autoload": {
"psr-4": {
"ReeceM\\Settings\\": "src/"
},
"files": [
"helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"ReeceM\\Settings\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-clover coverage"
},
"extra": {
"laravel": {
"providers": [
"ReeceM\\Settings\\SettingsServiceProvider"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
14 changes: 14 additions & 0 deletions config/setting.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

return [
/***********************************************
| CHEX ADMIN USERS
|
*/
'admins' => env('APP_ADMINS', ''),

/**
* This is for the logging of routes visited by a user by means of middleware
*/
'log' => false
];
34 changes: 34 additions & 0 deletions migrations/2019_04_12_212752_create_settings_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(config('setting.db.table'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('key')->unique();
$table->text('value');
$table->string('type')->default('STRING');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('settings');
}
}
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"bulma": "^0.7.4",
"bulma-extensions": "^0.7.5",
"cross-env": "^5.2.0",
"jquery": "^3.2",
"laravel-mix": "^2.1.14",
"lodash": "^4.17.11",
"popper.js": "^1.14.7",
"vue": "^2.6.8",
"vue-template-compiler": "^2.6.8"
},
"dependencies": {
"axios-progress-bar": "^1.2.0",
"babel-polyfill": "^6.26.0",
"buefy": "^0.7.3",
"moment": "^2.24.0",
"node-sass": "^4.11.0",
"sweetalert": "^2.1.2"
}
}
Empty file added resources/js/app.js
Empty file.
Empty file added resources/sass/app.scss
Empty file.
Empty file.
84 changes: 84 additions & 0 deletions resources/views/partials/flash.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
@if(session('submit_okay'))
<div class="notification is-subtle-success animated fadeInDown" style="position: fixed; right: 1rem; top: 5rem; z-index: 999" onclick="this.remove()">
<span class="delete"></span>
{{ session('submit_okay')}}
</div>
@endif
@if(session('submit_error'))
<div class="notification is-subtle-danger animated fadeInDown" style="position: fixed; right: 1rem; top: 5rem; z-index: 999" onclick="this.remove()">
<span class="delete"></span>
{{ session('submit_error')}}
</div>
@endif

@if(null !== session('account'))
<div class="notification is-subtle-danger animated fadeInDown" style="position: fixed; right: 1rem; top: 5rem; z-index: 999" onclick="this.remove()">
<span class="delete"></span>
{{ session('account')}}
</div>
@endif
@if(session('contact_us_ok'))
<div class="notification is-subtle-success animated fadeInDown" style="position: fixed; right: 1rem; top: 5rem; z-index: 999" onclick="this.remove()">
<span class="delete"></span>
{{ session('contact_us_ok')}}
</div>
@endif
@if(session('contact_us_error'))
<div class="notification is-subtle-danger animated fadeInDown" style="position: fixed; right: 1rem; top: 5rem; z-index: 999" onclick="this.remove()">
<span class="delete"></span>
{{ session('contact_us_error')}}
</div>
@endif

@if(setting('global.flash'))
<section style="position: fixed; right: 1rem; top: 3.2rem; z-index: 999">
<div class="tile is-ancestor" >
<div class="tile is-parent is-vertical">
@foreach (setting('global.notice') as $key => $notice)
<div class="tile is-child">
<div class="notification is-subtle-{{$key}} animated fadeInDown" onclick="this.remove()">
<span class="delete"></span>
{{ $notice }}
</div>
</div>
@endforeach
</div>
</div>
</section>
@endif
@if(session('global.notice'))
@foreach (session('global.notice') as $key => $notice)
<div class="notification is-{{$key}} animated fadeInDown" onclick="this.remove()">
<span class="delete"></span>
{{ $notice }}
</div>
@endforeach
@endif

@if (cache('delete.restore.user'))
<div class="notification is-subtle-info animated fadeInDown" id="restore_user" style="position: fixed; left: 1rem; top: 5rem; z-index: 999">
<form action="{{ route('admin.users.restore', cache('delete.restore.user')->get('user')->id) }}" method="post">
@csrf
@method('PATCH')
You have <span class="countdown">30</span>s to restore the user <b>{{ cache('delete.restore.user')->get('user')->username }}</b> - <button class="md-button is-small">{{ __('Restore') }}</button>
</form>
</div>
@push('scripts')
<script>
var eventTime= {{ strtotime(cache('delete.restore.user')->get('time')->addSeconds(30)) * 1000 }}; // Timestamp - Sun, 21 Apr 2013 13:00:00 GMT
var currentTime = {{ strtotime(now()) * 1000 }}; // Timestamp - Sun, 21 Apr 2013 12:30:00 GMT
var diffTime = eventTime - currentTime;
var duration = moment.duration(diffTime, 'milliseconds');
var interval = 1000;
let intervalId = setInterval(function(){
duration = moment.duration(duration - interval, 'milliseconds');
if(duration.seconds() < 0) {
$("#restore_user").remove();
clearInterval(intervalId);
}
$('.countdown').text(duration.seconds());
}, interval);
</script>
@endpush
@endif
35 changes: 35 additions & 0 deletions resources/views/partials/pagin.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@if ($paginator->hasPages())
@if ($paginator->onFirstPage())
<a class="pagination-previous" title="This is the first page" disabled>Previous</a>
@else
<a class="pagination-previous" href="{{ $paginator->previousPageUrl() }}" rel="prev">Previous</a>
@endif

{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next</a>
@else
<a class="pagination-next" disabled><span>Next<a>
@endif

<ul class="pagination-list">
{{-- Previous Page Link --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<li><span class="pagination-ellipsis">&hellip;</span></li>
@endif

{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<li ><a class="pagination-link is-current"> {{ $page }}</a></li>
@else
<li><a class="pagination-link" href="{{ $url }}">{{ $page }}</a></li>
@endif
@endforeach
@endif
@endforeach
</ul>
@endif
Loading

0 comments on commit 45d495b

Please sign in to comment.