use Illuminate\Database\Eloquent\Builder;
Builder::macro('search', function ( $tableFields, $searchValues, $splitOn = null, $addOwnWildCard = true) {
$tableFields = (array) $tableFields;
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Collective\Html\{FormFacade as Form , HtmlFacade as Html}; | |
class FormMacroServiceProvider extends ServiceProvider | |
{ | |
/** |
//To Get Size of all the Databases | |
//please Avoid using this it will take very Long time based on the number of databases | |
$sizeOfAllDataBases = DB::table('information_schema.TABLES') | |
->select(['TABLE_NAME as TableName','table_rows as TableRows','data_length as DataLength','index_length as IndexLength','TABLE_SCHEMA as DatabaseName']) | |
->get() | |
->map(function($eachDatabse){ | |
$dataIndex = $eachDatabse->DataLength + $eachDatabse->IndexLength; |
<?php | |
/* | |
Class for reading and writing array data in json format | |
Author: Sarfraz Ahmed ([email protected]) | |
*/ | |
class JsonTexter | |
{ | |
protected $file = null; | |
public function __construct($file) |
<?php | |
use Illuminate\Database\Query\Builder; | |
Builder::macro('orderByNulls', function ($column, $direction = 'asc', $nulls = 'last', $bindings = []) { | |
$column = $this->getGrammar()->wrap($column); | |
$direction = strtolower($direction) === 'asc' ? 'asc' : 'desc'; | |
$nulls = strtolower($nulls) === 'first' ? 'NULLS FIRST' : 'NULLS LAST'; | |
return $this->orderByRaw("$column $direction $nulls", $bindings); | |
}); |
<?php | |
use Illuminate\Database\Eloquent\Builder as EloquentBuilder; | |
use Illuminate\Database\Query\Builder as QueryBuilder; | |
use Illuminate\Database\Query\Expression; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |
<template> | |
<div v-on:paginationModifyPage="changePageNumberToCurrent"> | |
<ul class="pagination"> | |
<li class="page-item"> | |
<a v-if="paginationData.current_page > 1" | |
class="page-link" | |
href="javascript:void(0)" | |
aria-label="Previous" | |
v-on:click.prevent="changePageNumberToCurrent(paginationData.current_page - 1)" |
<?php | |
class Json | |
{ | |
private static $line_break = '<br />'; | |
private static $o_tag = '<div style=\'margin-left:20px;\'>'; | |
private static $c_tag = '</div>'; |
<?php | |
class JobChunkerJob | |
{ | |
/** | |
* Array of the Request Data. | |
* | |
* @var array|null | |
*/ | |
public $arrayOfData = []; |
<?php | |
// ./config/logging.php | |
return [ | |
/* | |
|-------------------------------------------------------------------------- | |
| Split your daily logs by year/month folders | |
|-------------------------------------------------------------------------- |