This file contains hidden or 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 | |
// Add this override to your app/Exceptions/Handler.php | |
/** | |
* Render an exception to the console. | |
* | |
* @param \Symfony\Component\Console\Output\OutputInterface $output | |
* @param \Exception $e | |
* @return void |
This file contains hidden or 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
<div id="some-id"> | |
<category v-for="category in categories" | |
:id="category.id" | |
:name.sync="category.name" | |
</category> | |
// we add items to the categories array dynamically | |
<button @click="categories.push({})">Add categories</button> | |
</div> |
This file contains hidden or 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 | |
// given input ['name' => 'jarek'] | |
Request::only('name', 'email') | |
[ | |
"name" => "jarek", | |
"email" => null, // even if empty in the input, the key will be here | |
] | |
This file contains hidden or 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 | |
>>> $col = collect(json_decode(json_encode([['id' => 1,'bool' => 0, 'count' => 15], ['id' => 2, 'bool' => 1, 'count' => 20], ['id' => 3, 'bool' => 0, 'count' => 10], ['id' => 4, 'bool' => 1, 'count' => 16]]))) | |
=> Illuminate\Support\Collection {#935 | |
all: [ | |
{#936 | |
+"id": 1 | |
+"bool": 0 | |
+"count": 15 | |
} |
This file contains hidden or 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 | |
/** | |
* Print query with bindings instead of '?' | |
*/ | |
function toRaw($query) | |
{ | |
return vsprintf(str_replace('?', "'%s'", $query->toSql()), $query->getBindings()); | |
} | |
NewerOlder