Step-by-step guides for the work we actually do — Laravel, PHP, WordPress, MySQL, Linux servers, and the occasional rabbit hole. Every command has been run on a real machine; nothing is theoretical.
Validate a unique column on update in Laravel without rejecting the record's own value — use Rule::unique('table')->ignore($id) or the string…
Validate an email address in PHP with filter_var($email, FILTER_VALIDATE_EMAIL). Add checkdnsrr for MX records and a confirmation email to verify…
Make Select2 work in a Bootstrap modal by setting dropdownParent: $('#myModal'). The modal's focus trap blocks the dropdown unless it…
Get all records from the main table in Laravel even when there's no match in the joined table — use…
Upload only image files in PHP — don't trust $_FILES['x']['type']. Verify bytes with getimagesize(), whitelist IMAGETYPE_*, rename, and block script…
Upload files (images, anything) via Ajax with jQuery using FormData and contentType/processData false. Includes upload progress and the vanilla fetch…
Permanently disable binary logging in MySQL or MariaDB by adding skip-log-bin to my.cnf under [mysqld]. Verify with SHOW VARIABLES LIKE…
Switch from LiteSpeed to Apache in WHM/cPanel with /usr/local/lsws/admin/misc/cp_switch_ws.sh apache. If LiteSpeed is still running, stop it with lswsctrl stop.
Replace jQuery's .each() with vanilla JavaScript: document.querySelectorAll(sel).forEach(...) or for...of. Includes index access, early exit, and breaking out.
Run a function every time DataTables finishes loading via Ajax with the xhr.dt event. Compares with draw.dt and shows how…
Sign in to your account