This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
use Exception; | |
use Illuminate\Database\Eloquent\Builder; | |
trait HasCompositePrimaryKeyTrait | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('slugToHumanReadable')) { | |
function slugToHumanReadable($slug) | |
{ | |
return ucwords(str_replace('-', ' ', $slug)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (! function_exists('numberWithSign')) | |
{ | |
function numberWithSign($number) | |
{ | |
if ($number < 0) { | |
return round($number, 2); | |
} else { | |
return '+' . round($number, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (! function_exists('isDate')) | |
{ | |
function isDate($string) | |
{ | |
if (DateTime::createFromFormat('Y-m-d', trim($string)) !== FALSE) { | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (! function_exists('hashTagToLink')) | |
{ | |
function hashTagToLink($string) | |
{ | |
$hashTagMap = [ | |
'book' => 'books', | |
]; | |
$hashTags = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (! function_exists('floatToTime')) { | |
function floatToTime($time, $long = false) | |
{ | |
$minutes = fmod($time, 1) * 60; | |
$units = [ | |
'm' => 'm', | |
'h' => 'h', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Escape special characters in the given string of html. | |
* | |
* @param {String} html | |
* @return {String} | |
*/ | |
module.exports = { | |
escape: function(html) { | |
return String(html) | |
.replace(/&/g, '&') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
module.exports = { | |
debug: true, | |
entry: './src/index.js', | |
output: { | |
path: '.', | |
filename: "test-package.js" | |
}, | |
module: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// b/app/Tenant/Tenant.php | |
namespace Cms\Tenant; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Database\Eloquent\SoftDeletes; | |
NewerOlder