- php assoc array to correct js array of objs
$data = [
'Users' => 'abc',
'posts' => 'blabla',
];
collect($data)->map(function ($v, $k) {
return [
$data = [
'Users' => 'abc',
'posts' => 'blabla',
];
collect($data)->map(function ($v, $k) {
return [
<?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 |
Dont
hash the id on either boot::retrieved
or getIdAttribute()
because delete() & 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
UUID
but if u r using mysql, indexing will suffer<?php | |
namespace App\Traits; | |
use Fico7489\Laravel\Pivot\Traits\PivotEventTrait; | |
use OwenIt\Auditing\Auditable; | |
/** | |
* https://gist.github.com/AbbyJanke/4d245b22dbcec277c207f033f37dae3b. | |
*/ |
npm install --save vue-recaptcha
form
<my-form inline-template>
<form action="{{ route('...') }}" @submit.prevent="FormSubmit($event)">
// other inputs
<?php | |
namespace App; | |
use Closure; | |
class CommandEventsListener | |
{ | |
protected $startCallbacks = []; | |
protected $finishCallbacks = []; |
@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>
<?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){ |