Skip to content

Instantly share code, notes, and snippets.

View wichaksono's full-sized avatar
🤔
Coding Is Fun.. Right ?

Wakhid Wichaksono wichaksono

🤔
Coding Is Fun.. Right ?
View GitHub Profile
<?php
if (! function_exists('untrailingslashit')) {
function untrailingslashit( $string )
{
return rtrim( $string, '/\\' );
}
}
if (! function_exists('trailingslashit')) {
function trailingslashit( $string )
<?php
class My_Widget extends WP_Widget {
/**
* Sets up the widgets name etc
*/
public function __construct() {
$widget_ops = array(
'classname' => 'my_widget',
'description' => 'My Widget is awesome',
<?php
/**
* Change this /path if you load assets from local
* example 'css' => asset('/css/app.css'),
*/
return [
'css' => 'https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.1.5/css/iziToast.min.css',
'js' => 'https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.1.5/js/iziToast.min.js'
];
@wichaksono
wichaksono / flash_me.php
Created January 12, 2018 01:27
part of flash me 'resources/lang/en/flash_me.php' https://www.onphpid.com/
<?php
/**
* @link https://www.onphpid.com/membuat-alert-message-yang-lebih-menarik-di-laravel.html
*/
return [
'success' => [
'type' => 'success',
'title' => 'Hi...',
'message' => 'FlashMe is Ready!',
'options' => [
<?php
/**
* Routing
*/
Route::get('/', function(){
return view('welcome');
});
Route::get('/flash-me', function(){
flashMe()->success();
@if ( flashMe()->ok() )
{!! flashMe_flash() !!}
@endif
<?php
//.....
Route::get('/flash-me', function(){
flashMe()->success();
dd(session()->all()); // dump
return redirect()->to('/');
});
//....
<?php
//...
public function store(Request $request)
{
$save = false;
if ( $save ) {
flashMe()->success();
<?php
//...
'providers'=>[
Ken\FlashMe\FlashMeServiceProvider::class,
]
//...
<html>
<head>
<title>Datatable Server Side</title>
</head>
<body>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>