İlk temizlik tamamlandı bir önceki projeden

This commit is contained in:
Ümit Tunç
2026-04-28 21:14:25 +03:00
commit f80443aec0
10000 changed files with 959965 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
<?php
/**
* Try catch kullanarak index değerine göre yoksa ekler
*/
function firstOrCreate($data, $table, $debug=false) {
try {
$data['created_at'] = simdi();
$id = db($table)->insertGetId($data);
return $id;
} catch (\Throwable $th) {
if($debug) {
dump($th);
}
}
} ?>