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\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Support\Facades\Cookie; | |
use Illuminate\Support\Facades\Mail; | |
use Illuminate\Support\Facades\Session; | |
use Ratchet\WebSocket\Version\RFC6455\Connection; |
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
# Example for MySQL 5.7 how to use JOIN on 2 tables without junction table using new JSON column type. | |
# Let say we have 2 tables: posts and users | |
# Users may like posts | |
# We store the IDs of users who liked each post in posts.liked column which is a JSON array | |
# which might have a content like "[1, 2, 5, 10]" | |
SELECT posts.id AS post_id, users.id AS liked_by_user_id FROM posts JOIN users ON JSON_CONTAINS(posts.liked, CAST(users.id AS CHAR)) |
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\Core; | |
use Illuminate\Support\Facades\Lang; | |
use Pelago\Emogrifier; | |
class Mailer extends \Illuminate\Mail\Mailer | |
{ | |
/** | |
* Send a new message using a view. | |
* |
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
/* | |
Native Object.create() does not works with properties if they are objects or arrays. | |
For example, | |
var p = { | |
obj: { | |
one: 1, | |
two: 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 | |
namespace App\Models\Traits; | |
use Illuminate\Support\Facades\DB; | |
use PDO; | |
trait Iterable | |
{ | |
public static function iterate(array $columns = []) |
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 // after locale | |
'additional_locales' => ['de'], |