Tutorials for Developers & Sysadmins

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.

How to Validate a Unique Column on Update in Laravel

Validate a unique column on update in Laravel without rejecting the record's own value — use Rule::unique('table')->ignore($id) or the string…

how7o

How to Validate an Email Address in PHP

Validate an email address in PHP with filter_var($email, FILTER_VALIDATE_EMAIL). Add checkdnsrr for MX records and a confirmation email to verify…

how7o

How to Use Select2 Inside a Bootstrap Modal

Make Select2 work in a Bootstrap modal by setting dropdownParent: $('#myModal'). The modal's focus trap blocks the dropdown unless it…

how7o

How to Use LEFT JOIN in Laravel to Keep All Records

Get all records from the main table in Laravel even when there's no match in the joined table — use…

how7o

How to Upload Only Image Files Using PHP

Upload only image files in PHP — don't trust $_FILES['x']['type']. Verify bytes with getimagesize(), whitelist IMAGETYPE_*, rename, and block script…

how7o

How to Upload Files via Ajax with jQuery

Upload files (images, anything) via Ajax with jQuery using FormData and contentType/processData false. Includes upload progress and the vanilla fetch…

how7o

How to Disable Binary Logging in MySQL or MariaDB

Permanently disable binary logging in MySQL or MariaDB by adding skip-log-bin to my.cnf under [mysqld]. Verify with SHOW VARIABLES LIKE…

how7o

How to Switch from LiteSpeed to Apache in WHM/cPanel

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.

how7o

How to Replace jQuery’s .each() with Vanilla JavaScript

Replace jQuery's .each() with vanilla JavaScript: document.querySelectorAll(sel).forEach(...) or for...of. Includes index access, early exit, and breaking out.

how7o

How to Trigger a Function When DataTables Loads Data

Run a function every time DataTables finishes loading via Ajax with the xhr.dt event. Compares with draw.dt and shows how…

how7o