Building pixel perfect apps for 1 billion people. Areas: social network, delivery, finance, logistics.
**TikTok, October, 2023 – Present
<?php | |
function duplicateCount($text) { | |
$ret = 0; | |
$a = []; | |
$t = str_split( strtolower( $text ) ); | |
$l = count($t); | |
for($i=0; $i<$l; $i++){ | |
$c = $t[$i]; | |
if ( array_key_exists($c, $t) ){ | |
if( $t[$c] === 1 ) |
Source: https://medium.com/@Mahmoud_Zalt/eloquent-relationships-cheat-sheet-5155498c209
One to one ( 1-1 ) |
One to many ( 1-n ) |
Poly one to many ( 1x-n ) |
Many to many ( n-n ) |
Poly many to many ( nx-n ) |
|
---|---|---|---|---|---|
Number of models | 2 only | 2 only | 3 and above | 2 only | 3 and above |
Number of tables | 2 (1/model) | 2 (1/model) | 3+ (1/model) | 3 (1/model + pivot) | 4+ (1/model + pivot) |
Pivot table | - | - | - | required |