<?php
protected function groupSimilarByFunc($array, $fieldName, $similarity, $ignore_pattern = null)
{
$crntLocale = LaravelLocalization::getCurrentLocale();
$list = [];
foreach ($array as $one) {
$field = $one->$fieldName();
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 | |
function getFilePath($disk, $filename) | |
{ | |
$config = config("filesystems.disks.$disk"); | |
$url = app('filesystem')->disk($disk)->url($filename); // get the file url | |
$root = array_get($config, 'root'); | |
// for other disks without root ex."cloud" | |
if (!$root){ |
- we dont use
@input
to save changes as it will reset the cursor, so we use@blur
instead
<td contenteditable dir="auto"
v-html="someText"
@keydown.enter.prevent
@input="newEntry()"
@blur="saveNewValue($event)">
</td>
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; | |
use Closure; | |
class CommandEventsListener | |
{ | |
protected $startCallbacks = []; | |
protected $finishCallbacks = []; |
Frontend "https://github.com/DanSnow/vue-recaptcha"
-
npm install --save vue-recaptcha
-
form
<my-form inline-template>
<form action="{{ route('...') }}" @submit.prevent="FormSubmit($event)">
// other inputs
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 Fico7489\Laravel\Pivot\Traits\PivotEventTrait; | |
use OwenIt\Auditing\Auditable; | |
/** | |
* https://gist.github.com/AbbyJanke/4d245b22dbcec277c207f033f37dae3b. | |
*/ |
Dont
-
hash the id on either
boot::retrieved
orgetIdAttribute()
becausedelete() & forceDelete()
wont work as they create a new query which will keep getting the same hashed id -
use
Route::bind
in the service provider as its applying the bind globally.
Maybe
- save the hashed id to the db same as
UUID
but if u r using mysql, indexing will suffer
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 | |
// use Illuminate\Support\Collection; | |
// use Illuminate\Pagination\Paginator; | |
// use Illuminate\Pagination\LengthAwarePaginator; | |
/** | |
* Gera a paginação dos itens de um array ou collection. | |
* | |
* @param array|Collection $items |
OlderNewer