<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rafi Halilintar on Medium]]></title>
        <description><![CDATA[Stories by Rafi Halilintar on Medium]]></description>
        <link>https://medium.com/@masitings?source=rss-dbff2669c35d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Bhl9Q2P5i2d0ko9S0sZBOA.jpeg</url>
            <title>Stories by Rafi Halilintar on Medium</title>
            <link>https://medium.com/@masitings?source=rss-dbff2669c35d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:10:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@masitings/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[PHP2Shell: Find and Patch Every PHP Server You Run (2026)]]></title>
            <link>https://masitings.medium.com/php2shell-find-and-patch-every-php-server-you-run-2026-b7dfa7a5ac3a?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7dfa7a5ac3a</guid>
            <category><![CDATA[programmer]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 00:00:40 GMT</pubDate>
            <atom:updated>2026-10-23T17:58:37.296Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*glytVEffGYqhYgbt.png" /></figure><p>On October 21, 2026, the PHP project shipped emergency releases for PHP2Shell, two critical bugs in the PHP engine itself, tracked as CVE-2026–109618 and CVE-2026–109619. They allow unauthenticated remote code execution and remote reads of worker memory, and they don’t depend on your application code. A “Hello World” script on an affected version is enough. This guide is the practical part: how to find every PHP runtime you’re actually serving traffic with, patch it, confirm the old workers are gone, and look for signs someone got there first.</p><h3>Quick Summary: What You’ll Learn</h3><ul><li>What PHP2Shell is and which setups are at risk</li><li>Why php -v can lie to you about what&#39;s serving requests</li><li>How to patch on Debian/Ubuntu, RHEL-family, Docker and FrankenPHP</li><li>Temporary mitigations if you can’t patch today, and their limits</li><li>Log signals worth checking for exploitation</li></ul><h3>What is PHP2Shell, and is my server affected?</h3><p>PHP2Shell is the name Wiz Research gave to a set of memory-safety bugs in how PHP handles fatal errors, mostly out-of-memory errors, while it processes a request. An interrupted request can leave corrupted internal state behind, and a later request handled by the same worker reuses it. Wiz chained these into pre-authentication RCE against the latest WordPress, Drupal and Joomla container images, and separately showed that an attacker can read chunks of worker memory, which can include passwords, tokens and API keys from other requests.</p><p>Per the PHP security advisory:</p><ul><li><strong>Fixed versions:</strong> PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35.</li><li><strong>At risk:</strong> every PHP installation serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The PHP team rates mod_php as highest risk, because the demonstrated exploit fires before any application code runs.</li><li><strong>PHP 8.1 and older</strong> get no upstream release. Your distribution or LTS vendor may ship a backport; the PHP team also published minimal source backports for 7.4, 8.0 and 8.1 for people building from source.</li><li><strong>Affected range:</strong> Wiz reports every release back to PHP 5.4 is hit by at least one of the bugs.</li></ul><p>If you run anything on PHP, assume you’re affected until you’ve checked.</p><h3>How do I find which PHP versions are actually serving traffic?</h3><p>This is where most patch rounds go wrong. The CLI binary, the FPM binary and the Apache module are separate packages with separate config, and they can be on different versions. Checking php -v over SSH tells you about the CLI only.</p><p>Start by finding what’s running:</p><p>The first line shows FPM masters and pools, CGI, FrankenPHP and LiteSpeed processes. The second shows whether Apache has mod_php loaded.</p><p>For PHP-FPM, ask the running binary directly rather than whatever php is on your PATH:</p><p>pgrep -o picks the oldest matching process, which is the FPM master. If readlink prints a path ending in (deleted), the binary on disk was replaced by an update but the old master is still running the previous code. That server is not patched yet, whatever the package manager says.</p><p>For containers, check inside each one:</p><p>For FrankenPHP, the PHP version is embedded in the binary. A small script run through its CLI mode tells you which one:</p><h3>Distro packages: why the version number isn’t the whole answer</h3><p>Debian, Ubuntu and RHEL often backport security fixes into the version they already ship instead of moving to upstream 8.3.36 or 8.2.35. A package can be fixed while php -v still prints an older-looking number. Check the package changelog for the CVE instead:</p><p>Swap the package name for whatever you run ( libapache2-mod-php8.3, php8.2-cgi, and so on). No match means your vendor hasn&#39;t shipped the fix for that package yet, or you&#39;re on a repo that doesn&#39;t track it.</p><p>One specific warning from the PHP advisory: if you rely on the volunteer-run rpms.remirepo.net, it did not have updates on disclosure day. The advisory recommends switching to distribution packages or building from source so you can patch immediately.</p><h3>How do I patch PHP for PHP2Shell?</h3><p>The patch itself is ordinary. The part people skip is restarting every worker.</p><p>On Debian or Ubuntu:</p><p>On RHEL-family systems:</p><p>If you use mod_php, restart Apache ( systemctl restart apache2 or httpd), since the module lives inside the Apache workers. For Docker, pull or rebuild the image on a fixed tag and redeploy. If you pin images by digest, the old digest stays vulnerable until you update it. For FrankenPHP, upgrade the binary or image to a release built on a fixed PHP version and restart the service. If you followed our <a href="https://termique.app/blog/deploy-laravel-frankenphp-vps/">Laravel with FrankenPHP guide</a>, that means replacing the binary and restarting the systemd unit.</p><p>Then re-run the checks from the previous section. You’re done with a host when the running binary reports a fixed version (or the changelog shows the CVE), readlink no longer shows (deleted), and the master process started after the update:</p><h3>What can I do if I can’t patch today?</h3><p>The PHP team is explicit that these measures reduce exposure to specific attack paths and do not make an installation safe. Use them to buy hours, not weeks.</p><ul><li><strong>Disable session upload progress.</strong> Set session.upload_progress.enabled=0 in php.ini, the FPM pool or the server config, then restart every worker. Setting it with ini_set() or a .user.ini file does not help, because the bug fires during request parsing, before those apply.</li><li><strong>Lower request size limits.</strong> post_max_size = 8M if the app takes no uploads, 32M if it does, with upload_max_filesize below it. Enforce limits on request body size, multipart part count and header count at the proxy too.</li><li><strong>Remove the controllable memory-limit failure.</strong> The advisory suggests memory_limit=-1, set where applications can&#39;t override it, plus a container or cgroup memory limit as the availability boundary. Don&#39;t use RLIMIT_AS or RLIMIT_DATA for this; those can trigger the vulnerable allocation failure.</li><li><strong>On PHP 8.5,</strong> set fatal_error_backtraces=0 and restart workers.</li></ul><p>In an FPM pool, php_admin_* values can&#39;t be overridden by the application:</p><p>Remember the CLI has its own php.ini on most distros (/etc/php/8.3/cli/ vs /etc/php/8.3/fpm/ on Debian). Checking php -i from the shell doesn&#39;t tell you what FPM loaded.</p><p>Several CDNs and WAF vendors, including Cloudflare and Fastly, announced rules for PHP2Shell. That’s a useful layer, but it only covers traffic that actually goes through them. Anything reachable directly by IP bypasses it.</p><h3>How do I check whether a server was already exploited?</h3><p>Wiz notes these bugs fire below the application layer, so application logs may show very little. The signals they recommend looking for:</p><ul><li>Unusual multipart requests followed by memory-limit errors or repeated HTTP 500s</li><li>Unexpectedly large or malformed PHPSESSID cookies in responses</li><li>Unexplained PHP worker churn</li></ul><p>A first pass on a typical nginx + FPM box:</p><p>The first finds out-of-memory fatals, the second finds workers that crashed (segfaults are worth a closer look), and the third counts 500s in the current access log, assuming the default combined format. None of these proves exploitation on its own. A cluster of all three around the same multipart POSTs is what deserves an incident.</p><p>If anything looks wrong, treat it as a compromise of everything that process could read: rotate database passwords, API keys and session secrets the app uses, and invalidate active sessions. The memory disclosure bug means secrets can leak without any code execution. Then check the host itself, including authorized_keys, cron entries and new users, as you would after any RCE. The <a href="https://termique.app/blog/complete-guide-ssh-security-2026/">complete guide to SSH security</a> covers what to look at on the access side.</p><h3>Where termique fits</h3><p>None of this needs special tooling, but it gets tedious past a handful of servers. If you manage your hosts in termique, a few things help. Save the version checks above as <a href="https://docs.termique.app/snippets">snippets</a> and run them in each session instead of retyping them. Snippets sync as plaintext, which is fine for commands like these but not for anything containing a secret. On Pro, incident investigation can run read-only commands across several selected hosts and assemble the results into a report, which suits the log checks in the last section; anything that changes the system still asks you first. And on shared hosts with command logging turned on, you get a record of who ran the patch and when, which is the question someone will ask later. More on that in <a href="https://termique.app/blog/per-command-audit-logs-shared-ssh-access/">what a per-command audit log actually catches</a>.</p><h3>FAQ</h3><h3>Is updating WordPress, Drupal or Laravel enough?</h3><p>No. The bugs are in PHP itself, not in the CMS or framework. You need a fixed PHP build, and every worker running it, regardless of what the application is.</p><h3>I’m on PHP 8.1 or older. What now?</h3><p>There’s no upstream release for 8.1 and older. Check whether your distribution or LTS vendor shipped a backport (the changelog check above), build from the PHP team’s source backports for 7.4 to 8.1, or use this as the push to move to a supported version.</p><h3>Does `php -v` tell me if I’m patched?</h3><p>Only for the CLI, and only if you’re on upstream version numbers. Check the running FPM, CGI or Apache module binary, and on distro packages check the changelog for the CVE IDs.</p><h3>Is a WAF or CDN enough protection?</h3><p>It reduces exposure for traffic routed through it. It does not protect a server that’s reachable directly, and the PHP team’s position is that updating is the only complete fix.</p><h3>Do I need to rotate secrets even if I patched quickly?</h3><p>If your servers were exposed and you see the log signals above, yes. The memory disclosure path can leak credentials without leaving the kind of trace an RCE would. If logs are clean and you patched early, rotation is a judgment call; for internet-facing apps that handle payments or auth, it’s cheap insurance.</p><p>If you’re juggling a lot of servers this week, <a href="https://termique.app/download/">termique</a> is free to try.</p><p><em>Originally published at </em><a href="https://termique.app/blog/php2shell-patch-php-servers/"><em>https://termique.app</em></a><em> on October 22, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7dfa7a5ac3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Termius Alternatives in 2026: 8 Options and How to Migrate]]></title>
            <link>https://masitings.medium.com/termius-alternatives-in-2026-8-options-and-how-to-migrate-cbbd74c4b8ca?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbbd74c4b8ca</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 00:00:15 GMT</pubDate>
            <atom:updated>2026-10-19T11:50:13.033Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mtABVgXkuVXFhKqS.png" /></figure><ul><li>Which Termius alternatives in 2026 actually replace what you use Termius for: sync, mobile, SFTP, team sharing, or just a nicer terminal.</li><li>What Termius costs today and what its free Starter plan still includes, so you know whether you need to switch at all.</li><li>Eight alternatives, from plain OpenSSH to self-hosted and mobile-first options, with the honest tradeoff for each.</li><li>A migration plan that works even though Termius’s docs don’t describe a host export: rebuild ~/.ssh/config, rotate keys, then cancel.</li></ul><p>You started using Termius because it was the easy way to keep the same hosts on a laptop, a desktop and a phone. Then sync turned out to be a paid feature, or the team plan quote came back per seat, or you just want something you can inspect. Whatever the reason, the hard part of leaving isn’t picking a new app. It’s getting twenty or two hundred hosts, their keys and their jump-host chains out without breaking access to production.</p><p>This guide covers both halves: the Termius alternatives worth looking at in 2026, and a migration path that doesn’t depend on an export button.</p><h3>What are the best Termius alternatives in 2026?</h3><p>There isn’t one replacement, because Termius bundles several jobs into one app. Pick by the job you actually need:</p><ul><li><strong>Free and open source on desktop:</strong> Tabby.</li><li><strong>Self-hosted, with a web UI and team sharing:</strong> Termix.</li><li><strong>End-to-end encrypted credential sync across desktop and mobile:</strong> termique.</li><li><strong>Multi-protocol (RDP, VNC and SSH in one place):</strong> Royal TS / Royal TSX.</li><li><strong>iPhone and iPad first:</strong> Blink Shell or Prompt 3.</li><li><strong>Nothing extra at all:</strong> OpenSSH with a well-organized ~/.ssh/config.</li><li><strong>A fast native desktop terminal with SFTP:</strong> WindTerm, with a caveat about release activity.</li></ul><p>Each one is covered below with what it’s good at and where it falls short. If you want a head-to-head on a single pair instead, the <a href="https://termique.app/vs/termius/">termique vs Termius comparison</a> goes feature by feature, and the broader <a href="https://termique.app/blog/best-ssh-client-developers-2026/">best SSH client for developers guide</a> covers PuTTY, iTerm2 and MobaXterm too.</p><h3>What does Termius cost in 2026, and do you need to switch?</h3><p>Before switching, check whether the free plan already covers you. Per Termius’s pricing page (checked October 16, 2026):</p><ul><li><strong>Starter (free):</strong> local vault, SSH and SFTP, AI-powered autocomplete, port forwarding. Commercial use is allowed.</li><li><strong>Pro ($10 per month, billed annually):</strong> adds a personal cloud vault, sync across mobile and desktop, session logs and snippet automation.</li><li><strong>Team ($20 per seat per month, billed annually):</strong> adds a shared team vault, real-time collaboration and shared session logs.</li><li><strong>Business ($30 per seat per month, billed annually):</strong> multiple team vaults with granular access control. SAML SSO is an add-on.</li><li><strong>Enterprise:</strong> custom pricing, adds SSO, a SOC 2 Type II report and migration support.</li></ul><p>So the line that matters is sync. If you use Termius on one machine, Starter is a capable free SSH and SFTP client and switching buys you little. If you need the same hosts on two devices, or you need to share hosts with a teammate, you’re looking at Pro or Team pricing, and that’s where most people start comparing.</p><h3>Which Termius alternatives are free and open source?</h3><h3>Tabby</h3><p>Tabby (formerly Terminus, a name that still causes confusion with Termius) is an MIT-licensed terminal for Windows, macOS and Linux. It includes an SSH2 client with a connection manager, Zmodem file transfer, agent forwarding (including Pageant and the native Windows OpenSSH agent), a serial terminal, and an integrated encrypted container for SSH secrets and configuration. There’s also a web app version that can be self-hosted. The project is active: the latest release at the time of writing is v1.0.238 from October 7, 2026.</p><p>Where it falls short: sync between machines isn’t built in. The README lists a community sync-config plugin that pushes your config to a GitHub Gist or Gitee, which works but is a plugin you trust separately. There&#39;s no mobile app. If you want a free, auditable desktop client and you work from one or two machines, Tabby is the closest like-for-like swap. The <a href="https://termique.app/vs/tabby/">termique vs Tabby page</a> compares the two directly.</p><h3>Termix</h3><p>Termix is the alternative that keeps coming up in self-hosting communities, and for good reason. It’s an Apache-2.0 licensed, self-hosted server management platform: you run the server, and you reach it from a web UI, a desktop app or mobile. The core stores hosts (nested folders, tags, import and export), credentials, users and sharing with four permission levels, plus an audit log. Everything else, including the SSH terminal, SFTP file manager, tunnels, Docker management and metrics, ships as plugins you can turn off.</p><p>The tradeoff is the one every self-hosted tool has. Its README says passwords and keys are encrypted per user and the database can be encrypted on disk, which is a sensible model, but the server that holds those secrets is now yours to patch, back up and keep off the public internet. For a homelab or a team that already runs internal services, that’s a fair trade. For a solo developer who wanted less to maintain, it’s more.</p><h3>WindTerm</h3><p>WindTerm is a fast native terminal for Windows, macOS and Linux with SSH, SFTP, Telnet, serial and tmux support. It’s free to download and has a large following on GitHub. The caveat for 2026: its latest GitHub release, 2.7.0, dates from March 11, 2025, and the repository hasn’t had a push since. That doesn’t make it unsafe today, but for a tool that holds your SSH credentials, a long gap between releases is worth weighing.</p><h3>Which alternative is best if you need sync and mobile?</h3><h3>termique</h3><p>termique is the SSH manager we build, so weigh this section accordingly. It runs on macOS, Windows and Linux as a native Tauri app, with a mobile companion app that signs in to the same account. The design choice that sets it apart: credentials are end-to-end encrypted. Your master password derives a key on your device, that key unwraps a random data encryption key, and every SSH password and private key is encrypted with it before it’s stored or synced. The server only ever holds ciphertext. The <a href="https://termique.app/blog/end-to-end-encrypted-ssh-credentials/">end-to-end encrypted SSH credentials explainer</a> walks through the model.</p><p>What’s honest to add:</p><ul><li><strong>Not everything is end-to-end encrypted.</strong> Credentials are. Hosts, groups and snippets sync as plaintext metadata, so the server can see hostnames and labels.</li><li><strong>The free plan caps you at 3 hosts and 10 snippets.</strong> It includes SFTP, unlimited terminal sessions, SSH key management and sync. Pro is $5 per month ($40 per year) and removes the caps, and adds command logs and host sharing.</li><li><strong>Lose the master password and your credentials are gone.</strong> There’s no reset path, by design.</li><li><strong>It’s an SSH manager.</strong> If your day involves serial consoles, Telnet or Mosh, Termius, Tabby or Prompt 3 cover those.</li></ul><p>If what pushed you off Termius is paying for sync, or not wanting a vendor to be able to decrypt the keys you sync to your phone, termique is built for that combination.</p><h3>Royal TS and Royal TSX</h3><p>Royal TS (Windows) and Royal TSX (macOS), with iOS and Android apps, are connection managers rather than SSH clients first. They handle RDP, VNC, SSH, Telnet, web pages and more from one document, and they support team sharing of those documents. If your fleet is a mix of Windows servers and Linux boxes, that’s a real advantage over any SSH-only tool. If you only ever open SSH sessions, it’s more product than you need. There’s a direct <a href="https://termique.app/vs/royal-tsx/">termique vs Royal TSX comparison</a> if you’re weighing those two.</p><h3>What’s the best Termius alternative for iPhone and iPad?</h3><h3>Blink Shell</h3><p>Blink Shell is a GPL-3.0 open-source terminal for iOS and iPadOS built around Mosh and SSH. Mosh is the reason people pick it: sessions survive switching networks and putting the device to sleep. It supports Ed25519, ECDSA and RSA keys, tunnels, ProxyCommand and an SSH agent, plus a set of local Unix tools and external keyboard support. It’s iOS only, so it replaces the phone half of Termius, not the desktop half. Check the App Store listing for current pricing.</p><h3>Prompt 3</h3><p>Prompt 3 from Panic runs on Mac, iPhone, iPad and visionOS, sold as one app across those platforms. It supports SSH, Mosh and Eternal Terminal, jump hosts, YubiKey, and Panic Sync, which syncs servers, keys and passwords between your Apple devices. If your whole setup is Apple, it’s the closest thing to Termius’s cross-device experience without a Termius subscription. If you also use Windows or Linux, it doesn’t follow you there.</p><h3>Can you replace Termius with plain OpenSSH?</h3><p>Often, yes. Termius’s host list, groups, jump hosts and per-host keys all map onto ~/.ssh/config, which every alternative above can read or at least coexist with. What you give up is the GUI, the mobile app and automatic sync. What you gain is a plain text file you can version, diff and copy anywhere.</p><p>A config that replaces a typical Termius group with a jump host looks like this:</p><p>ProxyJump replaces Termius&#39;s host chains, and IdentitiesOnly yes stops ssh from offering every key in your agent before the right one. The <a href="https://termique.app/blog/ssh-config-file-organization-tips-devops/">ssh config organization guide</a> covers splitting this into Include files per environment once it grows.</p><h3>How do you export hosts out of Termius?</h3><p>This is the part most “alternatives” lists skip. Termius’s current documentation describes importing hosts from ~/.ssh/config, CSV, PuTTY, MobaXterm and SecureCRT, but we couldn&#39;t find a documented way to export your host list (checked against docs.termius.com on October 16, 2026). The old termius-cli on GitHub had an export-ssh-config command, but that repository is archived and hasn&#39;t been updated since 2024. Treat it as history, not a migration tool.</p><p>That leaves a manual migration. Done in this order, it’s also a free key rotation.</p><h3>Step 1: Inventory every host into ~/.ssh/config</h3><p>Open each group in Termius and write each host as a Host block: alias, HostName, User, Port if it isn&#39;t 22, and ProxyJump for anything behind a host chain. Check each entry resolves the way you expect before you connect:</p><p>ssh -G prints the configuration ssh would use for that host after evaluating every Host and Match block, and exits without connecting. It catches typos and wildcard blocks that match more than you meant.</p><h3>Step 2: Generate new keys instead of moving old ones</h3><p>Keys that lived in a synced vault you’re leaving are keys you should retire. Generate a fresh one per device:</p><p>Give it a passphrase. Then install the public key on each server, while your old Termius access still works:</p><p>ssh-copy-id -i uses only the identity file you name, and because it reads your ssh config, the alias and ProxyJump from step 1 apply.</p><h3>Step 3: Test the new key on its own</h3><p>Prove the new key works without help from any other key in your agent:</p><p>Do this for every host before you remove anything. Keep one working session open to each critical server while you change authorized_keys, so a mistake doesn&#39;t lock you out.</p><h3>Step 4: Remove the old keys, then cancel</h3><p>Once every host passes step 3, delete the old public key lines from ~/.ssh/authorized_keys on each server. Match on the key&#39;s comment or fingerprint, not by guessing. ssh-keygen -lf ~/.ssh/authorized_keys lists the fingerprint and comment of every key in that file. The <a href="https://termique.app/blog/ssh-key-rotation-best-practices/">SSH key rotation best practices guide</a> covers doing this across a fleet. Copy any snippets you rely on into a text file or your new tool, and only then cancel the Termius subscription.</p><h3>Step 5: Load the new setup into your next tool</h3><p>With a working ~/.ssh/config and fresh keys, the next tool is the easy part. Tabby, WindTerm and Prompt 3 can all work from the same host details. In termique you add each host (address, port, user, and the key or password) and import the private key from <strong>Settings → SSH keys</strong>, where it&#39;s encrypted on your device before it syncs. On the free plan that&#39;s 3 hosts, so a larger fleet needs Pro.</p><h3>How do the Termius alternatives compare at a glance?</h3><ul><li><strong>Tabby:</strong> Windows, macOS, Linux. Free, MIT. Sync via community plugin. No mobile app.</li><li><strong>Termix:</strong> web, desktop and mobile clients for a server you host. Free, Apache-2.0. Sharing and roles built in.</li><li><strong>WindTerm:</strong> Windows, macOS, Linux. Free download. Latest release March 2025.</li><li><strong>termique:</strong> macOS, Windows, Linux plus a mobile companion. Free for 3 hosts, Pro $5 per month. End-to-end encrypted credentials.</li><li><strong>Royal TS / TSX:</strong> Windows, macOS, iOS, Android. Commercial. Multi-protocol, including RDP and VNC.</li><li><strong>Blink Shell:</strong> iOS and iPadOS. GPL-3.0. Mosh-first.</li><li><strong>Prompt 3:</strong> Mac, iPhone, iPad, visionOS. Paid. Panic Sync across Apple devices.</li><li><strong>OpenSSH + ~/.ssh/config:</strong> everywhere. Free. No GUI, no built-in sync.</li></ul><h3>FAQ</h3><h3>Is there a free Termius alternative?</h3><p>Several. Tabby and Termix are free and open source, WindTerm is a free download, and OpenSSH with ~/.ssh/config costs nothing. termique has a free plan for up to 3 hosts. Termius&#39;s own Starter plan is also free and includes SSH and SFTP, just without sync.</p><h3>Can I export my hosts from Termius?</h3><p>Termius’s current docs describe imports, not a host export. The practical route is to rebuild your hosts in ~/.ssh/config, check them with ssh -G, and use that file as the portable source for whichever tool you pick next.</p><h3>Is there an open-source Termius alternative?</h3><p>Yes. Tabby (MIT) is the closest desktop equivalent, Termix (Apache-2.0) is the closest self-hosted equivalent with a web UI and sharing, and Blink Shell (GPL-3.0) covers iOS.</p><h3>Is Terminus the same as Termius?</h3><p>No. Terminus was the original name of Tabby, an open-source terminal. It was renamed partly because the name was so close to Termius, a separate commercial SSH client.</p><h3>Do I need to rotate my SSH keys when leaving Termius?</h3><p>It isn’t required, but it’s the cleanest exit. Generating new keys during the move means no key you’re still trusting lives in an account you’ve cancelled, and the old ones come off your servers in the same pass.</p><h3>Try termique free</h3><p>If you want your hosts on every machine with credentials encrypted before they leave the device, <a href="https://termique.app/download/">download termique</a> and move your first three hosts over on the free plan.</p><p><em>Originally published at </em><a href="https://termique.app/blog/termius-alternatives-2026/"><em>https://termique.app</em></a><em> on October 19, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbbd74c4b8ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOC 2 Controls for SSH Access: CC6 and CC7 Mapped (2026)]]></title>
            <link>https://masitings.medium.com/soc-2-controls-for-ssh-access-cc6-and-cc7-mapped-2026-2f54a346c44c?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f54a346c44c</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 00:00:11 GMT</pubDate>
            <atom:updated>2026-10-20T13:06:01.756Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_SFTVjtIS5Erf8kW.png" /></figure><ul><li>Which SOC 2 Trust Services Criteria actually cover SSH access (CC6.1, CC6.2, CC6.3, CC6.6, CC6.7, CC7.2), quoted, not paraphrased.</li><li>The concrete SSH control that satisfies each one, with sshd_config lines checked against the OpenSSH manual.</li><li>The evidence an auditor will ask for on each control, and how to produce it without a PAM platform.</li><li>Where a Type II audit usually catches teams out on SSH, and where termique fits (and where it doesn’t).</li></ul><p>If you are preparing for SOC 2 and your engineers SSH into production, someone will eventually ask which SOC 2 controls for SSH access you have and how you prove they work. SOC 2 won’t answer that for you. The framework never says “disable password authentication” or “use certificates”. It states outcomes, and you pick the controls that achieve them. That freedom is useful, but it also means a lot of teams show up to the audit with good SSH hygiene and no clean story of which criterion each setting supports. This guide is that story.</p><h3>Which SOC 2 controls apply to SSH access?</h3><p>SSH access is logical access to production systems, so most of it lands in the <strong>CC6 series (Logical and Physical Access Controls)</strong>, with monitoring in <strong>CC7.2</strong>. These are the criteria from the AICPA’s 2017 Trust Services Criteria (with the revised points of focus) that an auditor will map your SSH controls to (criteria text quoted, shortened where you see “…”):</p><ul><li><strong>CC6.1:</strong> “The entity implements logical access security software, infrastructure, and architectures over protected information assets to protect them from security events…” For SSH: how people authenticate to servers at all. Keys or certificates, no shared accounts, no passwords.</li><li><strong>CC6.2:</strong> “Prior to issuing system credentials and granting system access, the entity registers and authorizes new internal and external users… user system credentials are removed when user access is no longer authorized.” For SSH: approval before a key lands on a server, and key removal at offboarding.</li><li><strong>CC6.3:</strong> “The entity authorizes, modifies, or removes access… based on roles, responsibilities, or the system design and changes, giving consideration to the concepts of least privilege and segregation of duties…” For SSH: who can reach which hosts, as which user, and who can become root.</li><li><strong>CC6.6:</strong> “The entity implements logical access security measures to protect against threats from sources outside its system boundaries.” For SSH: port 22 not open to the whole internet. Bastion, VPN, or allow-listed source ranges.</li><li><strong>CC6.7:</strong> “The entity restricts the transmission, movement, and removal of information to authorized internal and external users and processes, and protects it during transmission…” For SSH: encrypted transport (SSH gives you this) plus control over file transfer and forwarding.</li><li><strong>CC7.2:</strong> “The entity monitors system components and the operation of those components for anomalies that are indicative of malicious acts, natural disasters, and errors…” For SSH: authentication logs and command logs that someone actually reviews.</li></ul><p>Two things to keep in mind before mapping controls:</p><ul><li><strong>The criteria are the requirement; the controls are yours.</strong> Your auditor tests the controls you describe in your system description. If you say “all production SSH uses short-lived certificates”, that is what gets tested, so don’t write down controls you only partly run.</li><li><strong>Type I vs Type II changes what “evidence” means.</strong> A Type I report checks that the controls are designed and in place on one date. A Type II report checks that they operated across the whole review period, so the auditor samples dates and people and expects records from months ago. Our post on <a href="https://termique.app/blog/soc-2-audit-trail-requirements-devops-teams-2026/">SOC 2 audit trail requirements</a> covers the logging side of that in more depth.</li></ul><h3>How do you satisfy CC6.1 for SSH authentication?</h3><p>CC6.1 is about the authentication mechanism itself. For SSH, an auditor wants to see three things: individual identities (no shared deploy or ubuntu login used by five people), a strong authentication method, and that the configuration is enforced, not just documented.</p><p>A baseline sshd_config that supports CC6.1:</p><p>PasswordAuthentication no KbdInteractiveAuthentication no PermitRootLogin no AuthenticationMethods publickey</p><p>Notes from the sshd_config(5) manual worth knowing before you paste this:</p><ul><li>PasswordAuthentication defaults to yes, so you have to turn it off explicitly.</li><li>PermitRootLogin defaults to prohibit-password, which still allows root with a key. Setting it to no forces people to log in as themselves and escalate with sudo, which is what gives you per-person attribution later.</li><li>AuthenticationMethods publickey means only public key authentication completes a login. If you require a second factor, this is also where you would list several methods that must all succeed.</li></ul><p>Before you reload sshd, keep a second session open and test a fresh key login from a new terminal. Locking yourself out of a production host is a bad way to start an audit period.</p><p><strong>Evidence the auditor asks for:</strong> the effective configuration, not the file. sshd -T runs extended test mode and prints the effective configuration to stdout, which is the honest answer to &quot;is this actually enforced?&quot;:</p><p>sudo sshd -T | grep -Ei &#39;^(passwordauthentication|kbdinteractiveauthentication|permitrootlogin|authenticationmethods)&#39;</p><p>Capture that output per host (or per image, if hosts are built from a golden image) on a schedule, and you have dated evidence for a Type II sample.</p><h3>How do you prove CC6.2 onboarding and offboarding for SSH keys?</h3><p>CC6.2 has two halves: access is authorized *before* credentials are issued, and credentials are *removed* when access ends. SSH makes the second half hard, because a public key in authorized_keys keeps working until someone deletes it, on every host it was copied to.</p><p>There are two workable patterns:</p><ul><li><strong>Static keys with a single source of truth.</strong> Keys live in config management (Ansible, Puppet, cloud-init, or similar), each key is tied to a named person, and a merged change with an approval is your authorization record. Offboarding is a change that removes the key everywhere. Evidence: the approved change for a sample of joiners and leavers, plus a scan of authorized_keys across hosts showing the leaver&#39;s key is gone.</li><li><strong>SSH certificates from a CA.</strong> Servers trust a CA via TrustedUserCAKeys, and engineers get short-lived certificates instead of permanent key entries. From ssh-keygen(1):</li></ul><p>ssh-keygen -s /path/to/ca_key -I <a href="https://termique.app/cdn-cgi/l/email-protection">[email protected]</a> -n alice -V +8h /path/to/alice_key.pub</p><p>-I sets the key identifier that the server logs when the certificate is used, -n sets the principals (usernames) the certificate is valid for, and -V sets the validity interval. A certificate that expires in hours means offboarding mostly happens on its own: stop issuing, and access ends when the last certificate expires. For a compromised key before expiry, sshd_config supports RevokedKeys, which accepts a plain list or a Key Revocation List built with ssh-keygen -k. One warning from the manual: if the RevokedKeys file is unreadable, public key authentication is refused for all users, so deploy it carefully.</p><p>We compared the two approaches in <a href="https://termique.app/blog/ssh-certificate-authority-vs-public-key-auth-teams/">SSH certificate authority vs public key auth for teams</a>. For SOC 2, either is fine. What fails audits is a third pattern: keys added by hand, by whoever had root, with no record.</p><p><strong>Evidence the auditor asks for:</strong> HR or ticket records for joiners and leavers in the period, the matching approval for each key (or certificate issuance log), and proof the leaver’s access ended within your stated SLA. For key inventories, ssh-keygen -l -f ~/.ssh/authorized_keys prints the fingerprint of every key in the file, which is easier to match against a register than raw base64.</p><h3>What does least privilege (CC6.3) look like for SSH?</h3><p>CC6.3 is where “everyone in engineering can SSH into everything as a sudoer” gets written up. The criterion asks you to give access based on role and to consider least privilege and segregation of duties. For SSH that usually means:</p><ul><li><strong>Restrict who can log in at all, per host class.</strong> AllowGroups limits login to users whose primary or supplementary group matches. Pair it with groups from your directory (prod-ssh, db-ssh) so access follows role, not individual edits on each box.</li><li><strong>Separate login from root.</strong> Engineers log in as themselves; sudo rules decide who can escalate and to what. That gives you two layers an auditor can test separately.</li><li><strong>Scope service accounts.</strong> CI and automation keys should use authorized_keys options like a forced command or source-address restriction, so a leaked deploy key can&#39;t open an interactive shell.</li></ul><p><strong>Evidence the auditor asks for:</strong> a periodic access review. Someone with authority looks at who has SSH access to which systems, confirms it still matches their role, and signs off; removals get ticketed. Quarterly is a common cadence, but use whatever you wrote in your policy and stick to it. If that review is currently a spreadsheet someone rebuilds from memory, see <a href="https://termique.app/blog/ssh-access-review-without-spreadsheets-2026/">how to run an SSH access review without spreadsheets</a>.</p><h3>How does CC6.6 apply to SSH exposed to the internet?</h3><p>CC6.6 covers threats from outside your system boundary. Port 22 open to 0.0.0.0/0 is the obvious finding. The fix is to put a boundary in front of SSH:</p><ul><li>A <strong>bastion host</strong> that is the only machine reachable from outside, with everything else accepting SSH only from the bastion. Our <a href="https://termique.app/blog/bastion-host-proxyjump-setup/">bastion host and ProxyJump setup</a> walks through the client side.</li><li>Or a <strong>VPN / zero-trust network</strong>, with SSH only on private addresses.</li><li>Or, at minimum, <strong>security group or firewall rules</strong> that allow SSH only from known office or VPN ranges.</li></ul><p>The bastion pattern also helps CC7.2, because it gives you one choke point where authentication and session logs are guaranteed to exist.</p><p><strong>Evidence the auditor asks for:</strong> firewall or security group rules showing SSH is not open to the world, and a network diagram that matches them.</p><h3>Where does CC6.7 come in for file transfer and forwarding?</h3><p>SSH encrypts transport, so the “protects it during transmission” part of CC6.7 is largely covered by using SSH (and SFTP) instead of plaintext protocols. The part teams forget is *restricting movement*. Agent forwarding, TCP forwarding and unrestricted SFTP are all ways data or credentials leave their intended boundary. Not every environment needs to turn them off, but you should be able to say which hosts allow what and why. Agent forwarding in particular is worth a deliberate decision; we covered the risk in <a href="https://termique.app/blog/ssh-agent-forwarding-security-risks-explained/">SSH agent forwarding security risks</a>.</p><h3>What SSH logging does CC7.2 need?</h3><p>CC7.2 asks you to monitor for anomalies and analyze them. Logging alone doesn’t meet it; someone or something has to look. For SSH there are two layers:</p><ul><li><strong>Authentication events.</strong> sshd writes to syslog or the journal at LogLevel INFO by default. Each successful login records the user, source address and method, and for public key logins the key&#39;s fingerprint, so you can attribute a login to a specific key. If you use certificates, the -I key identifier shows up here too. Don&#39;t raise LogLevel to DEBUG in production; the manual notes that DEBUG logging violates users&#39; privacy and is not recommended.</li><li><strong>What happened inside the session.</strong> Authentication logs tell you who got in, not what they did. For that you need command or session logging: auditd execve rules (which track the original login identity even after sudo), session recorders like tlog, or a tool that logs commands at the client or proxy. The tradeoffs are covered in <a href="https://termique.app/blog/ssh-session-logging-options-compared/">SSH session logging options compared</a>.</li></ul><p>Then the part auditors actually test for CC7.2:</p><ul><li><strong>Ship logs off the host.</strong> A log that the same root user can edit is weak evidence. Forward to a central store where engineers with production SSH can’t delete entries.</li><li><strong>Alert on a short list of real signals.</strong> Logins from unexpected networks, logins to root, repeated failed authentication, access outside on-call hours to sensitive hosts. Fewer, reviewed alerts beat a dashboard nobody opens.</li><li><strong>Keep a review record.</strong> A ticket or a short note each week or month saying “reviewed SSH auth alerts, nothing unusual” (or what was found and done) is the difference between a control that exists and one that operated.</li></ul><h3>What evidence should you have ready for each control?</h3><p>A compact checklist you can hand to whoever owns the audit:</p><ul><li><strong>CC6.1:</strong> sshd -T output per host class, dated; list of shared accounts (ideally none) with justification for any that remain.</li><li><strong>CC6.2:</strong> sample of joiners and leavers with matching key or certificate approvals and removal timestamps; current key register with fingerprints.</li><li><strong>CC6.3:</strong> latest access review with sign-off; AllowGroups and sudoers configuration; service-account key restrictions.</li><li><strong>CC6.6:</strong> firewall or security group rules for SSH; network diagram; bastion configuration.</li><li><strong>CC6.7:</strong> documented decision on agent and TCP forwarding per environment.</li><li><strong>CC7.2:</strong> sample of authentication logs from the central store, alert definitions, and the review record for the period.</li></ul><p>The written policy that ties these together is its own document; our <a href="https://termique.app/blog/compliance-ready-ssh-access-policy-without-enterprise-pam/">compliance-ready SSH access policy template</a> is a starting point for that.</p><h3>Where does termique fit into SOC 2 SSH controls?</h3><p>termique is an SSH client, so it sits on the engineer’s side of the connection. It does not replace server-side controls: sshd_config, AllowGroups, firewall rules and central log shipping still have to exist on your infrastructure, and nothing in a client can enforce them.</p><p>What it can help with, based on what the <a href="https://docs.termique.app/">docs</a> describe for the Pro plan:</p><ul><li><strong>Command logs per host (CC7.2 support).</strong> When command logging is enabled on a host, entries record a timestamp, session ID, the input (and terminal output, if enabled), whether input was pasted, and the termique user who ran the session. That is useful who-ran-what context on shared hosts. Be clear about its limits for audit purposes: these logs are stored on the termique backend in plaintext, not end-to-end encrypted, and the host owner can delete logs older than a given date. Treat them as operational context alongside your server-side, append-only logs, not as your tamper-evident record.</li><li><strong>Host sharing without handing out the password (CC6.2, CC6.3 support).</strong> A Pro user can share a host with teammates; the credential is re-encrypted for the recipient on acceptance, and the owner can revoke access. Two honest caveats from the docs: there are no permission levels (a shared host gives full connect access), and revoking doesn’t remove the recipient’s local copy of the host entry. For SOC 2 offboarding, still rotate the server-side credential.</li><li><strong>Credentials encrypted end to end.</strong> Passwords and private keys are encrypted on the device before sync, so the server only holds ciphertext. Hosts, groups and snippets sync as plaintext metadata.</li></ul><p>termique is a free, native ssh manager we build, with end-to-end encrypted credentials. Command logs and host sharing are on Pro at $5/month (or $40/year), and the Teams roster on Pro includes up to 5 teammates. If your team is small and SSH is the least-instrumented access path in your audit scope, it’s a cheap way to add per-person command context on shared hosts. If you need session recording with enforced retention, an access proxy or PAM tool is the better fit.</p><h3>FAQ</h3><h3>Does SOC 2 require SSH keys instead of passwords?</h3><p>No. SOC 2 doesn’t name specific authentication methods. CC6.1 requires logical access security that protects your systems, and your auditor judges whether your chosen controls do that. In practice, key or certificate authentication with passwords disabled is the easiest position to defend, and password-only SSH to production tends to draw questions.</p><h3>Which SOC 2 criteria cover SSH access?</h3><p>Mainly CC6.1 (authentication and access security), CC6.2 (granting and removing credentials), CC6.3 (least privilege), CC6.6 (protection from outside the boundary) and CC6.7 (protecting data in transit), with CC7.2 for monitoring. Depending on how you deploy changes, CC8.1 (change management) can also touch SSH if engineers change production by hand.</p><h3>Do we need a PAM tool to pass SOC 2?</h3><p>Not necessarily. A small team can pass with sshd hardening, keys or certificates managed in config management, a bastion, central logging and a documented access review. A PAM or access proxy makes evidence easier to produce at scale, especially session recording and just-in-time access, but SOC 2 doesn&#39;t require one.</p><h3>How long should SSH logs be kept for SOC 2?</h3><p>SOC 2 doesn’t set a fixed number. Your retention has to cover the full Type II review period so the auditor can sample from it, and it has to match what your own policy says. Pick a window that covers the review period with some margin, write it down, and make sure your log store actually enforces it.</p><h3>Are SSH certificates better than keys for SOC 2?</h3><p>They make CC6.2 easier because access expires automatically and each certificate carries an identifier that shows up in logs. Static keys work too if they are tied to named people, managed from one source of truth, and removed at offboarding. Pick the one your team will actually operate consistently for the whole audit period.</p><h3>Try termique free</h3><p>If you want per-person command context on shared hosts and an SSH client that keeps credentials end-to-end encrypted across macOS, Windows, Linux and iOS, <a href="https://termique.app/download/">download termique</a> and start on the free plan.</p><p><em>Originally published at </em><a href="https://termique.app/blog/soc-2-controls-ssh-access/"><em>https://termique.app</em></a><em> on October 15, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f54a346c44c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Laravel package I shipped never ran once]]></title>
            <link>https://masitings.medium.com/the-laravel-package-i-shipped-never-ran-once-e5d3a8d8b60c?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5d3a8d8b60c</guid>
            <category><![CDATA[composer]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[packagist]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Mon, 24 Aug 2026 05:16:23 GMT</pubDate>
            <atom:updated>2026-08-24T05:16:23.975Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hTgpVz_eKB6uARBo_WMyRA.jpeg" /></figure><p>I put <a href="https://github.com/masitings/laravel-migration-squash">masitings/laravel-migration-squash</a> on Packagist three days ago. Badges in the README, a VERIFICATION_REPORT.md saying it was production ready, a commit called <em>&quot;feat: Add comprehensive test coverage for v1.0.0.&quot;</em></p><p>The command it shipped, php artisan migrate:squash, died on an undefined variable before it got anywhere near a database. Behind that error were five more fatal errors, each one waiting for the previous one to be cleared before it could take its turn.</p><p>I asked for a code review because I wanted to write an announcement post. I got seven rounds instead. Three of them found bugs that the previous round’s fixes had introduced, and the last one only happened because I generated the code samples for this article by actually running the thing. Here is all of it.</p><h3>The idea</h3><p>You open database/migrations on a project that has been alive for four years and there are ninety files in there. Half of them are add_x_to_y and drop_z_from_y against the same three tables. Nobody can tell you the shape of users without replaying the whole history in their head.</p><p>So: run the full history in a throwaway sandbox, read the schema that comes out, write one clean migration per table. Then run those generated migrations in a second fresh sandbox and diff the two schemas. If they differ at all, stop and change nothing on disk.</p><p>That last step is the whole point. Concatenating migrations is easy. The reason to use a tool for it is that the tool proves the result is identical.</p><p>Keep that in mind for later.</p><h3>What it actually looks like</h3><p>Here is a migration folder from an app that has been running since 2019. Fifteen files, and six of them exist only to alter tables the other nine created.</p><pre>2019_08_19_000000_create_users_table.php<br>2019_08_19_000001_create_password_reset_tokens_table.php<br>2019_08_19_000002_create_jobs_table.php<br>2020_01_10_000000_create_teams_table.php<br>2020_01_10_000001_create_projects_table.php<br>2020_03_02_000000_create_project_user_table.php<br>2020_06_15_000000_add_team_id_to_users.php<br>2020_09_01_000000_add_status_to_projects.php<br>2021_02_11_000000_add_avatar_and_bio_to_users.php<br>2021_05_20_000000_add_indexes_to_projects.php<br>2021_11_03_000000_add_foreign_keys.php<br>2022_04_18_000000_create_comments_table.php<br>2023_01_09_000000_add_settings_to_teams.php<br>2023_07_22_000000_make_project_description_required.php<br>2024_02_14_000000_create_activity_log_table.php</pre><p>To know what users looks like you have to read file 1, then file 7, then file 9, and hold the result in your head.</p><p>Run php artisan migrate:squash and you get nine files, one per table plus one for the foreign keys:</p><pre>2019_08_18_235951_create_activity_log_table.php<br>2019_08_18_235952_create_comments_table.php<br>2019_08_18_235953_create_jobs_table.php<br>2019_08_18_235954_create_password_reset_tokens_table.php<br>2019_08_18_235955_create_project_user_table.php<br>2019_08_18_235956_create_projects_table.php<br>2019_08_18_235957_create_teams_table.php<br>2019_08_18_235958_create_users_table.php<br>2019_08_18_235959_add_foreign_keys.php</pre><p>The timestamps sit just before the earliest original file on purpose. Anything the tool refuses to touch, such as a migration containing raw SQL, keeps its original name and has to run after these, since Laravel orders migrations by filename.</p><p>users now reads as one thing, with the columns from 2020 and 2021 folded in where they belong:</p><pre>Schema::create(&#39;users&#39;, function (Blueprint $table) {<br>    $table-&gt;id();<br>    $table-&gt;unsignedBigInteger(&#39;team_id&#39;)-&gt;nullable();<br>    $table-&gt;string(&#39;name&#39;, 255);<br>    $table-&gt;string(&#39;email&#39;, 255);<br>    $table-&gt;timestamp(&#39;email_verified_at&#39;)-&gt;nullable();<br>    $table-&gt;string(&#39;password&#39;, 255);<br>    $table-&gt;string(&#39;remember_token&#39;, 100)-&gt;nullable();<br>    $table-&gt;timestamp(&#39;created_at&#39;)-&gt;nullable();<br>    $table-&gt;timestamp(&#39;updated_at&#39;)-&gt;nullable();<br>    $table-&gt;string(&#39;avatar_path&#39;, 255)-&gt;nullable();<br>    $table-&gt;text(&#39;bio&#39;)-&gt;nullable();<br>    $table-&gt;unique(&#39;email&#39;);<br>    $table-&gt;index(&#39;team_id&#39;);<br>});</pre><p>projects picks up the enum added in 2020 and both indexes added in 2021:</p><pre>Schema::create(&#39;projects&#39;, function (Blueprint $table) {<br>    $table-&gt;id();<br>    $table-&gt;unsignedBigInteger(&#39;team_id&#39;);<br>    $table-&gt;string(&#39;title&#39;, 255);<br>    $table-&gt;text(&#39;description&#39;)-&gt;nullable();<br>    $table-&gt;timestamp(&#39;created_at&#39;)-&gt;nullable();<br>    $table-&gt;timestamp(&#39;updated_at&#39;)-&gt;nullable();<br>    $table-&gt;enum(&#39;status&#39;, [&#39;draft&#39;, &#39;active&#39;, &#39;archived&#39;])-&gt;default(&#39;draft&#39;);<br>    $table-&gt;string(&#39;slug&#39;, 255)-&gt;nullable();<br>    $table-&gt;unique(&#39;slug&#39;);<br>    $table-&gt;index(&#39;team_id&#39;);<br>    $table-&gt;index([&#39;team_id&#39;, &#39;status&#39;]);<br>});</pre><p>Every foreign key goes in its own file, which runs last. That is what makes circular references work without any dependency sorting: all the tables exist by the time any constraint is added.</p><pre>Schema::table(&#39;comments&#39;, function (Blueprint $table) {<br>    $table-&gt;foreign(&#39;parent_id&#39;)-&gt;references(&#39;id&#39;)-&gt;on(&#39;comments&#39;)-&gt;onDelete(&#39;CASCADE&#39;);<br>    $table-&gt;foreign(&#39;project_id&#39;)-&gt;references(&#39;id&#39;)-&gt;on(&#39;projects&#39;)-&gt;onDelete(&#39;CASCADE&#39;);<br>    $table-&gt;foreign(&#39;user_id&#39;)-&gt;references(&#39;id&#39;)-&gt;on(&#39;users&#39;);<br>});</pre><pre>Schema::table(&#39;projects&#39;, function (Blueprint $table) {<br>    $table-&gt;foreign(&#39;team_id&#39;)-&gt;references(&#39;id&#39;)-&gt;on(&#39;teams&#39;)-&gt;onDelete(&#39;CASCADE&#39;);<br>});</pre><p>The originals are not deleted. They move to database/migrations-archive/2026_08_23_204512/ next to a manifest holding every filename and its md5, and php artisan migrate:squash:restore puts them back and refuses if any archived file no longer matches its hash.</p><p>Nothing is written or moved until you answer the confirmation prompt, and --dry-run skips the prompt entirely by never touching the disk in the first place.</p><h3>Round one</h3><p>Two of the six critical bugs I could reproduce in a scratch file:</p><pre>Error: Cannot indirectly modify readonly property Table::$columns<br>Error: Object of class Table could not be converted to string</pre><p>The Table value object declared $columns as readonly and then offered an addColumn() method that did $this-&gt;columns[] = $column. Anything that built a table died on the first column it tried to add.</p><p>The generator built PHP source using a heredoc and never escaped $table. In that scope $table was a Table object, so PHP tried to convert it to a string.</p><p>Then there was this:</p><pre>public function add(string $table, string $type, array $details): void<br>{<br>    $this-&gt;differences[] = compact(&#39;table&#39;, &#39;type&#39;, ...$details);<br>}</pre><p>Spreading an associative array into compact() turns its keys into named arguments. compact() is variadic and rejects named parameters it does not know:</p><pre>ArgumentCountError: compact() does not accept unknown named parameters</pre><p>Every call site passed a populated $details array except one. So the schema comparator threw a fatal error at the moment it found a difference. Finding differences is the only thing that function exists to do.</p><p>The sandbox was worse. SandboxConnectionFactory built a connection config array, returned it, and nothing ever registered it with Laravel. SandboxRunner called Artisan::call(&#39;migrate&#39;) with no --database argument, and its fresh() method ran SHOW TABLES followed by DROP TABLE in a loop. Every one of those queries would have hit the default connection. Your actual database. The only reason nobody lost data is that the fatal errors upstream stopped execution first.</p><p>And the tests. The README said “12 automated tests with 78%+ code coverage.” tests/Feature/ was an empty directory. The commit titled &quot;Add comprehensive test coverage&quot; had added four fixture files and no tests at all. I do not think anyone lied about this. Somebody wrote down what they expected to be true and then never checked.</p><p>Nine more high severity findings and thirteen medium ones came out of the same pass. The guard system meant to detect raw SQL in migrations returned compact(&#39;rawSql&#39;, &#39;dataSeeding&#39;) built from two local variables that were never assigned, so it returned empty arrays every single time and had never detected anything in its life.</p><p>I did not write the announcement post. I wrote a remediation PRD.</p><h3>Round two, on the fixes</h3><p>The remediation was solid work. Six defects survived it anyway.</p><p>Squashed migrations were written into database/migrations before the confirmation prompt, not after. Answer &quot;no&quot; and you were left holding both the originals and the new files, which means a duplicate Schema::create for every table the next time anyone ran migrate:fresh.</p><p>Migrations the guards excluded kept their original timestamps while the generated files used time(). Laravel runs migrations in filename order, so a guarded Schema::table(&#39;users&#39;, ...) from 2022 executed before the 2026 file that creates users.</p><p>The guards blocked DB::raw(). This one took me a while to appreciate. DB::raw() shows up in completely ordinary schema migrations, for example -&gt;default(DB::raw(&#39;CURRENT_TIMESTAMP&#39;)). Blocking it meant that migration never ran in the sandbox, so its tables never entered the &quot;before&quot; snapshot. Verification still passed, because both snapshots were built from the same reduced set of migrations. Verification cannot notice something it was never shown.</p><p>enum columns generated $table-&gt;enum(&#39;status&#39;, []), which renders as ENUM() and is not valid SQL.</p><h3>Round three, the first time MySQL ran</h3><p>The package had a --driver=mysql option that nobody had ever executed. I installed MariaDB in the test environment and pointed the suite at it.</p><p>The type normalizer stripped parenthesised lengths using a regex that matched digits inside parentheses. enum(&#39;draft&#39;,&#39;published&#39;) has no digits in there, so nothing matched and the entire raw string stayed on as the column&#39;s type. The generator did not recognise it, fell through to its default branch, and emitted $table-&gt;string(). Every enum in a MySQL schema quietly turned into a varchar(255).</p><p>MySQL also stores boolean as tinyint(1). The SQLite introspector already collapsed that back to boolean. The MySQL one did not, so booleans came back as tinyint(4) and verification failed on a length mismatch.</p><p>By this point the pattern was hard to miss. Every part of this package that had never actually been executed was broken.</p><h3>Round four, and a test that lied to me</h3><p>--table=members let you squash a subset of tables. If that subset contained a foreign key pointing at a table left outside it, the generated foreign key migration referenced a table the squashed set never creates. The command exited 0 and archived the originals. Whether the result migrated at all came down to how the leftover migration filenames happened to sort.</p><p>I wrote a test asserting the command refuses that case. It passed. I had not written the refusal yet.</p><p>$this-&gt;artisan(&#39;migrate:squash&#39;) without an expectsConfirmation() call fails on the unanswered prompt and returns exit code 1. That is indistinguishable from a refusal if all you assert is the exit code. I only found out because I ran the command through the kernel and printed the actual output, which reported success and listed the files it had archived.</p><p>I would rather have no test than one that passes for a reason I did not intend. The empty test directory in round one was at least honest about knowing nothing.</p><h3>Round five</h3><p>Everything so far had been tested against SQLite, because the sandbox was hardcoded to SQLite and SQLite is fast.</p><p>So I finally asked the question I should have asked at the very beginning. What does this package do to a MySQL application?</p><pre>--- what the SQLite sandbox reports ---<br>  id       type=integer  unsigned=false<br>  team_id  type=integer  unsigned=false</pre><pre>--- what the generator writes ---<br>  $table-&gt;increments(&#39;id&#39;);<br>  $table-&gt;integer(&#39;team_id&#39;);</pre><p>SQLite has no unsigned bigint. Push $table-&gt;id() through a SQLite sandbox and read it back and you get a plain integer. The generator does exactly what it is told and writes increments().</p><p>On MySQL, increments() is int. Not bigint unsigned. So the primary key of every table changes type, and every foreign key that points at one fails:</p><pre>SQLSTATE[HY000]: General error: 1005 Can&#39;t create table `members`<br>(errno: 150 &quot;Foreign key constraint is incorrectly formed&quot;)</pre><p>While producing that, the package printed:</p><pre>✅ Schema verification passed!</pre><p>It was not wrong, exactly. It really did compare two schemas and they really were identical. They were identical in SQLite. The verification was rigorous and completely disconnected from the database the user was actually going to deploy to.</p><p>That is the bug I keep thinking about. Everything else in this list either crashes or produces obviously broken output. This one hands you a green check, archives your migration history, and lets you find out at deploy time.</p><p>The sandbox driver now comes from database.default. If your app runs MySQL, the sandbox runs MySQL. An application on an engine with no faithful sandbox, which today means PostgreSQL, is refused outright rather than checked against SQLite and waved through. Refusing is the right answer there. Falling back to SQLite would be committing the same mistake on purpose.</p><h3>Round six, checking whether verification detects anything</h3><p>After that I stopped assuming the comparator worked. I wrote seventeen tests that each build two schemas differing in exactly one attribute and assert that the difference gets reported. Nullability, default, length, type, a missing column, a missing index, a unique index downgraded to a plain one, a missing foreign key, a changed onDelete, a missing table, enum values, collation, unsigned, comments.</p><p>Two of them failed.</p><p>Collation was never compared at all. Both introspectors had &#39;collation&#39; =&gt; null hardcoded, so every collation in every schema compared equal to every other collation. utf8mb4_unicode_ci and utf8mb4_bin were the same value as far as this tool was concerned.</p><p>I fixed that by reading collations out of SQLite’s CREATE TABLE statement, and the test still failed. Laravel writes collate &#39;NOCASE&#39; with single quotes, and my pattern accepted double quotes, backticks and brackets but not single ones. My fix found nothing and would have shipped looking like it worked.</p><p>The third failure was not a bug. SQLite cannot tell you a varchar length at all, because Laravel’s SQLite grammar writes &quot;name&quot; varchar not null no matter what size you asked for. That one became a documented limitation with a test pinning the behaviour, so at least it stops being a surprise.</p><h3>Round seven, which happened while I was writing this</h3><p>The code samples above are real output, not something I typed by hand for the post. I generated them by running the tool, and doing that found two more problems.</p><p>The first was cosmetic and still bad. The generated files came out like this:</p><pre>Schema::create(&#39;users&#39;, function (Blueprint $table) {<br>                        $table-&gt;increments(&#39;id&#39;);<br>            $table-&gt;string(&#39;name&#39;);</pre><pre>                        $table-&gt;unique(&#39;email&#39;);</pre><p>Double indentation on the first line of each block, and blank lines full of stray spaces wherever a section was empty. The stub had indented placeholders and the generated code carried its own indentation, so they stacked. For a tool that sells itself on producing a clean migration file, shipping that would have undercut the entire pitch.</p><p>The second one was a real bug, and it was sitting in the middle of the sample I was about to publish:</p><pre>$table-&gt;dropForeign([&#39;parent_id&#39;, &#39;project_id&#39;, &#39;user_id&#39;]);</pre><p>Laravel builds one index name from an array of columns, so that looks for a constraint called comments_parent_id_project_id_user_id_foreign. No such constraint exists. It should be three separate calls. Every rollback of a generated foreign key migration would have failed.</p><p>No test caught it because no test had ever run down(). The tool itself never rolls back, so nothing in the normal flow exercises that code. I have added a test that migrates the generated files and then rolls the whole thing back, and it now checks the tables are actually gone afterwards.</p><p>There is a small lesson in that. I found both of these by looking at the output as a reader rather than as an assertion. The test suite was asking “does this parse” and “does the schema match”, and both answers were yes the whole time.</p><h3>Where it ended up</h3><p>The package went from zero tests to 130, with 330 assertions and 87.1% line coverage measured by pcov rather than estimated in a README.</p><p>The test I trust most builds a fifteen migration history shaped like an application that has been running for years. Framework tables, a domain on top, and then the drift: columns added later, indexes attached a year after the table, foreign keys bolted on in their own migration, an enum, a JSON column, a composite primary key, a self referencing foreign key. It squashes that for real, runs only the squashed output against an empty database, and compares the result to what the original fifteen produced. Empty diff on SQLite and on MySQL. A second test restores the archive and checks all fifteen originals come back byte for byte.</p><h3>What I would tell myself three days ago</h3><p>Six separate times, the thing that had never been executed turned out to be broken. Not usually broken. Broken every time. I had been treating “this code looks correct” as a reasonable substitute for running it, and it is not close.</p><p>The other one is about that green check. A crash sends you straight to a stack trace and a fatal error stops you before you do damage, so in a strange way those were the friendly bugs. The dangerous one was the one that succeeded loudly while measuring the wrong thing. If I had shipped a working version with only that defect left in it, someone would have trusted it and lost their migration history, and the tool would have told them everything was fine.</p><p>v1.1.0 is on Packagist now. v1.0.0 and v1.0.1 do not work, so skip those. Start with --dry-run, which reads your migrations and writes nothing.</p><p>There is a BACKLOG.md in the repo with what is still open, including the limitations I decided to document rather than fix. If you find a seventh round in there, I would like to hear about it.</p><p>Github : <a href="https://github.com/masitings/laravel-migration-squash">https://github.com/masitings/laravel-migration-squash</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5d3a8d8b60c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create a WhatsApp Chatbot Using WhatsApp API in Laravel]]></title>
            <link>https://masitings.medium.com/how-to-create-a-whatsapp-chatbot-using-whatsapp-api-in-laravel-996c7eba2ed9?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/996c7eba2ed9</guid>
            <category><![CDATA[whatsapp-marketing]]></category>
            <category><![CDATA[whatsapp-bot]]></category>
            <category><![CDATA[whatsapp]]></category>
            <category><![CDATA[api-whatsapp]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 18:52:51 GMT</pubDate>
            <atom:updated>2024-09-16T18:56:20.978Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sEJ70WmiSOLeBChPJSXWRg.png" /></figure><p>WhatsApp chatbots are becoming essential for businesses looking to automate interactions with customers. With Laravel’s powerful framework and a WhatsApp API like <strong>CrunchzApp</strong>, you can build a chatbot to automatically handle messages, queries, and more.</p><p>In this guide, we’ll show you how to create a WhatsApp chatbot using the WhatsApp API in Laravel.</p><p><strong>Prerequisites</strong></p><p>Before starting, ensure you have the following ready:</p><ul><li><strong>PHP</strong> (7.4 or above)</li><li><strong>Laravel</strong> (8.x or 9.x)</li><li>A <strong>WhatsApp API</strong> (such as CrunchzApp)</li><li>A <strong>WhatsApp Business Account</strong> (if using the official API)</li></ul><blockquote><strong><em>Free Trial</em></strong><em><br>Get started with a free 7-day trial at </em><a href="https://www.crunchz.app/"><em>CrunchzApp</em></a><em> and use your own WhatsApp number to integrate into your Laravel app!</em></blockquote><h3>Step 1: Install Laravel</h3><p>If you haven’t installed Laravel yet, use this command to set up a new project:</p><pre>composer create-project --prefer-dist laravel/laravel whatsapp-bot</pre><h3>Step 2: Install WhatsApp API SDK (CrunchzApp)</h3><p>To interact with WhatsApp, we’ll use <strong>CrunchzApp</strong>, a platform that enables you to automate messaging via WhatsApp. Install the SDK by running:</p><pre>composer require crunchzapp/crunchzapp-php-sdk</pre><h3>Step 3: Configure API Credentials</h3><p>Add your CrunchzApp API credentials in the .env file like this:</p><pre>CRUNCHZAPP_CHANNEL_TOKEN=<br>CRUNCHZAPP_GLOBAL_TOKEN=<br>CRUNCHZAPP_GLOBAL_OTP=</pre><p>To get your API key and channel ID, register for an account at <a href="https://www.crunchz.app/">CrunchzApp</a>.</p><h3>Step 4: Set Up Routes for the Chatbot</h3><p>To handle incoming messages, create a route in routes/web.php:</p><pre>use App\Http\Controllers\ChatBotController;<br><br>Route::post(&#39;/webhook&#39;, [ChatBotController::class, &#39;handleWebhook&#39;]);</pre><h3>Step 5: Create the ChatBotController</h3><p>Next, create a controller to process incoming messages and send automated replies. Use the following command:</p><pre>php artisan make:controller ChatBotController</pre><p>Inside ChatBotController.php, implement the chatbot logic:</p><pre>namespace App\Http\Controllers;<br><br>use Illuminate\Http\Request;<br>use CrunchzApp\CrunchzApp;<br><br>class ChatBotController extends Controller<br>{<br>    public function handleWebhook(Request $request)<br>    {<br>        $message = $request-&gt;input(&#39;body&#39;);<br>        $from = $request-&gt;input(&#39;from&#39;);<br>        // Basic chatbot logic<br>        if ($message == &#39;hello&#39;) {<br>            $this-&gt;sendMessage($from, &#39;Hello! How can I help you today?&#39;);<br>        } elseif ($message == &#39;help&#39;) {<br>            $this-&gt;sendMessage($from, &#39;Here are the available commands...&#39;);<br>        } else {<br>            $this-&gt;sendMessage($from, &#39;Sorry, I did not understand that. Type &quot;help&quot; for options.&#39;);<br>        }<br>    }<br>    private function sendMessage($contact, $text)<br>    {<br>        CrunchzApp::channel()<br>            -&gt;contact($contact)<br>            -&gt;text(message: $text)<br>            -&gt;send();<br>    }<br>}</pre><h3>Step 6: Configure Webhook in CrunchzApp</h3><p>In order to enable real-time messaging, you need to configure a webhook within your <strong>CrunchzApp</strong> dashboard.</p><p>To do this:</p><ol><li>Log in to your CrunchzApp account.</li><li>Navigate to <strong>Channel &gt; [Your Channel] &gt; Webhook</strong>.</li><li>Set the webhook URL to your Laravel app’s /webhook route: &#39;https://yourdomain.com/webhook&#39;</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GhiLwWWU9aNoogh2.png" /></figure><p>CrunchzApp allows you to register two types of webhook events:</p><ol><li><strong>Channel status</strong></li><li><strong>Messages</strong></li></ol><p>For this chatbot, we’ll focus on the <strong>Messages</strong> event. When a message is received, the following payload will be sent to your webhook:</p><pre>{<br>  &quot;message_id&quot;: &quot;false_xxx@c.us_xxx&quot;,<br>  &quot;from&quot;: &quot;xxx@c.us&quot;,<br>  &quot;body&quot;: &quot;hello&quot;,<br>  &quot;status&quot;: &quot;PENDING&quot;,<br>  &quot;timestamp&quot;: 1234561221<br>}</pre><h3>Step 7: Test Your WhatsApp Chatbot</h3><p>Now that your webhook is set up, you can test your chatbot by sending a message to the WhatsApp number linked to your API. If configured correctly, you should receive automated responses based on your chatbot’s logic.</p><p>For example:</p><ul><li>Send <strong>“hello”</strong> → receive: <em>“Hello! How can I help you today?”</em></li><li>Send <strong>“help”</strong> → receive: <em>“Here are the available commands…”</em></li></ul><h3>Step 8: Enhance Your Chatbot</h3><p>To take your chatbot further, consider implementing:</p><ul><li><strong>Natural Language Processing (NLP)</strong>: Use services like Dialogflow to make your bot smarter and more interactive.</li><li><strong>User Data Storage</strong>: Store user preferences in a database to provide personalized interactions.</li><li><strong>Error Handling</strong>: Ensure the chatbot handles unexpected inputs gracefully.</li></ul><h3>Conclusion</h3><p>You’ve just created a basic WhatsApp chatbot using the CrunchzApp API and Laravel! This is just the starting point — you can enhance it by adding more features and integrations. Remember, you can sign up for a free 7-day trial at <a href="https://www.crunchz.app/">CrunchzApp</a> to start automating your WhatsApp messages today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=996c7eba2ed9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WhatsOTP — A new way for providing an OTP through Whatsapp!]]></title>
            <link>https://masitings.medium.com/whatsotp-a-new-way-for-providing-an-otp-through-whatsapp-02fbfc98146f?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/02fbfc98146f</guid>
            <category><![CDATA[whatsapp-marketing]]></category>
            <category><![CDATA[post]]></category>
            <category><![CDATA[whatsapp]]></category>
            <category><![CDATA[otp-services]]></category>
            <category><![CDATA[otp-verification]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 06:57:42 GMT</pubDate>
            <atom:updated>2024-07-14T06:57:42.455Z</atom:updated>
            <content:encoded><![CDATA[<h3>WhatsOTP — A new way for providing an OTP through Whatsapp!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0vF5znUB_yKswRZumMsCQ.jpeg" /></figure><p>Hey there! We’re super excited to introduce <strong>WhatsOTP</strong>, our new and improved WhatsApp OTP service! After our first launch and a few tweaks here and there, we’re back with a fresh approach that’s all about making your OTP experience as smooth and reliable as possible.</p><h4>Why You’ll Love WhatsOTP</h4><p>In today’s digital world, OTPs (One-Time Passwords) are essential for keeping things secure. We wanted to create a service that not only works great but also feels easy and user-friendly. After facing some hiccups with blocked accounts, we took a step back, revamped our approach, and now we’re thrilled to share the new WhatsOTP with you.</p><h4>What Makes WhatsOTP Special?</h4><p><strong>1. You Start the Conversation</strong> With WhatsOTP, you’re in control! You kick off the chat, which means you’re the one driving the interaction. This not only boosts security but also makes sure you’re always in the know about what’s happening.</p><p><strong>2. Simple and Clear Validation</strong> Once you start the chat, we send you a validation message to let you know if your OTP is good to go. It’s straightforward and hassle-free, making the whole process a breeze.</p><p><strong>3. No Personal Numbers Needed</strong> Forget about managing multiple accounts or installing new apps. WhatsOTP provides all the phone numbers you need. Just use our service, and you’re all set without any extra steps.</p><h4>Exciting Future Features</h4><p>We’re always working on making WhatsOTP even better. One of the cool features we’re planning to add soon is the option for you to have your own channels or WhatsApp installations. This will give you even more flexibility to tailor the service to your needs.</p><h4>Ready to Try WhatsOTP?</h4><p>We can’t wait for you to try WhatsOTP and see how it can make your life easier. Whether you’re a developer, business owner, or part of a digital agency, WhatsOTP is here to handle your OTP needs effortlessly.</p><p>Check it out on RapidAPI: <a href="https://rapidapi.com/masitingss/api/whatsotp">https://rapidapi.com/masitingss/api/whatsotp</a></p><p>Stay tuned for more awesome updates and new features as we keep working to make WhatsOTP your go-to WhatsApp OTP solution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02fbfc98146f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy your NextJS application using AWS Amplify.]]></title>
            <link>https://masitings.medium.com/deploy-your-nextjs-application-using-aws-amplify-148bae2209e5?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/148bae2209e5</guid>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 06:27:55 GMT</pubDate>
            <atom:updated>2024-04-18T06:27:55.336Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iy-vyCm77RbFKizS.jpg" /></figure><p>Hi friends, here i am again and today i want to share with you some of my experience deploying my landing page website using AWS Amplify.</p><h3>TLDR</h3><p>Long short story, i’ve been working on SaaS application called <a href="https://www.kelasuji.ai/">Kelasuji.ai</a> basically this platform allows teacher and student to communicate about their activity inside a classroom which include Online Exam, Online Home Work/Task with help using AI.</p><h3>What is AWS Amplify</h3><p>Crafting applications entailed managing a multitude of components such as setting up back-end infrastructure, handling databases, implementing user authentication, designing the front-end, and more. This comprehensive method frequently led to extended development timelines, heightened maintenance demands, and posed a significant learning challenge for developers.</p><p>But in this case, we’re only using AWS Amplify to deploy our Landing Page without any Amplify addition behind.</p><h3>Warming Up</h3><p>To begin start using AWS Amplify the first thing you need is an AWS account ( any region or depends on what’s makes you comfort with ) in this case im using ap-southeast ( Singapore ) and next do this step :</p><p>Login to your AWS account and inside the dashboard or any pages, there will be a search box appears on top of the site. Type in “Amplify” and you will see one that appears on the first place. Click on that and you will be directed to the Amplify dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A6hVVJNKS_PAAJBE9hZ5Zw.png" /></figure><p>At the dashboard of Amplify, you need to scroll down a bit until you see the “Getting Started” section and from there choose “Amplify Hosting”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RTRtgHjTelTsHzP-FYf1Ww.png" /></figure><p>At this point, you will see any git providers available that can be integrate with AWS Amplify and you can choose what provider your repository are. In this point im using Github, so i need to authorize some permission for Amplify in Github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*XcNy8MZyouIIdrjQGEkfCw.png" /></figure><p>After you authorize the Amplify in your github’s account, you will see something like this where you can choose on what repository that you need to deploy and what branch you want to deploy inside Amplify. After that, click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yDvQCOsRo26fyHu-JZadXQ.png" /></figure><h3>Getting Hot</h3><p>Well, i think this article is long enough for me to feel exhausted.. Let me take my coffee.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*_b5u4LTUVp_Cd5h3XAeq6g.png" /></figure><p>Once you hit Next button, you will see something like this. You can change the App Name with whatever name you want to listed later in Amplify.</p><p>And then we need to edit a bit on section <strong>Build and test settings </strong>change it by simply click <strong>Edit</strong> button and replace it with the code below.</p><pre>version: 1<br>frontend:<br>  phases:<br>    build:<br>      commands:<br>        - npm install<br>        - npm run build<br>  artifacts:<br>    baseDirectory: .next<br>    files:<br>      - &#39;**/*&#39;<br>  cache:<br>    paths:<br>      - .next/cache/**/*<br>      - .npm/**/*</pre><p>The reason of why we’re not using the <strong>preBuild </strong>phase is because we really don’t need the <strong>npm ci</strong> to run otherwise it will cause any error build or in my case it will broke because it didn’t pass it and for the rest leave it as it was.</p><p>Below it, you will see some button text called <strong>Advanced settings </strong>you need to click it and configure. Basically this allows amplify to know what are you want to deploy by configure what image and what version you want to use on this deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*5ozGBH2LUzoP5kMXU1vGdw.png" /></figure><p>At this point, i just need to add the <strong>Live package updates </strong>with Node.JS version <strong>20.11.1 .</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*39KD1yyhzomPu75CLmYAHg.png" /></figure><p>And next for <strong>IAM Role </strong>you can choose the existing one that you’ve been created before or you just simply create by choosing the options. In this case i will create a new service role. After that, click on Next button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7TajLssJexSn_qcWAZfKEQ.png" /></figure><p>After that, you will see the last step of deployment which Reviewing the step on what you’ve done before. Click on <strong>Save and Deploy </strong>to deploy your site. It will take sometimes to deploy but don’t worry this won’t take long on the next event you pushed some update on repository later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YU_fnMMRX4p8qYQUloa8nQ.png" /></figure><p>You will be redirected to the dashboard of your deployment and you will see something like this on where the steps are your deployment now at.</p><p>Most of the error that i’ve facing on this step was in <strong>Build </strong>when we didn’t remove the <strong>preBuild </strong>phase, it will caused error and till now im not so sure what i’ve doing wrong on my code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_5ALvq_W4C0AJinKaJsbg.png" /></figure><p>After all complete, you will see the steps are changing to Green tick and now you can access the site by clicking on the url on the left side ( im not sure what is it called but its under the preview i guess)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*XcFExkRwHCjKNZDPG5fwyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HthqOxEJKa0vJ1o1IUUwOg.png" /></figure><p>And yeah, the site is now deployed. Now you can try to change something inside your repository to see if the CI/CD or event listening from amplify is worked.</p><p>And that’s it, i hope this article didn’t make you confuse to do it but im trying my best to explain every steps as detail as possible.</p><h3>Conclussion</h3><p>It might be something in our mind when it comes with AWS, usually AWS price are too expensive for us to pay with but in this case i believe Amplify is not that expensive compared to Vercel or other cloud services out there as this only charged per request and per gb bandwidth plus we’re using NextJS with SSR so it free for 500k request a month. for more detail about the price you can see in this website</p><p><a href="https://aws.amazon.com/amplify/pricing/">https://aws.amazon.com/amplify/pricing/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=148bae2209e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intresno: Inovasi Undangan Pernikahan Digital untuk Masa Depan yang Praktis dan Ramah Lingkungan]]></title>
            <link>https://masitings.medium.com/intresno-inovasi-undangan-pernikahan-digital-untuk-masa-depan-yang-praktis-dan-ramah-lingkungan-7fd8e9ddbf98?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fd8e9ddbf98</guid>
            <category><![CDATA[undangan-pernikahan-unik]]></category>
            <category><![CDATA[pernikahan]]></category>
            <category><![CDATA[undangan-pernikahan]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 11:05:14 GMT</pubDate>
            <atom:updated>2023-11-14T11:05:14.891Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Sebuah Lompatan Revolusioner dalam Tradisi Pernikahan: Undangan Pernikahan Digital dengan </em><a href="https://www.intresno.com/"><em>Intresno</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DbmNrbC-kGsxY6xOvKxsA.png" /><figcaption>Intresno — Platform Undangan Pernikahan Digital</figcaption></figure><p>Dalam era digital ini, di mana teknologi terus berkembang pesat, setiap aspek kehidupan kita mengalami transformasi, termasuk tradisi pernikahan. Salah satu perubahan signifikan adalah beralihnya banyak pasangan menuju undangan pernikahan digital. Di tengah kebutuhan akan solusi yang praktis, ramah lingkungan, dan efisien, platform <a href="https://www.intresno.com/">Intresno</a> hadir sebagai jawaban yang sempurna untuk kebutuhan undangan pernikahan modern.</p><h3>Mengapa Undangan Pernikahan Digital?</h3><p>Tradisi undangan pernikahan fisik yang menggunakan kertas seringkali melibatkan biaya tinggi dan membutuhkan waktu yang cukup lama. Selain itu, dampaknya terhadap lingkungan juga perlu diperhatikan, mengingat pemanfaatan kertas yang melibatkan pemakaian kayu dan proses produksi yang dapat mencemari lingkungan. Dalam konteks ini, undangan pernikahan digital menjadi alternatif yang menarik.</p><p><a href="https://www.intresno.com/">Intresno</a> menawarkan solusi inovatif dengan memadukan desain elegan dan kemudahan penggunaan. Platform ini memungkinkan pasangan untuk membuat undangan pernikahan digital yang personal dan unik sesuai dengan gaya dan tema pernikahan mereka.</p><h3>Keuntungan Menggunakan Intresno:</h3><ol><li>Praktis dan Efisien: Proses pembuatan undangan pernikahan digital dengan <a href="https://www.intresno.com/">Intresno</a> sangat mudah dan cepat. Pasangan dapat menghemat waktu dan tenaga yang biasanya dibutuhkan untuk mencetak, mengemas, dan mengirim undangan fisik.</li><li>Ramah Lingkungan: Dengan menggunakan undangan pernikahan digital, pasangan tidak hanya menghemat kertas tetapi juga mengurangi dampak lingkungan yang dihasilkan dari proses produksi dan distribusi kertas.</li><li>Desain Kreatif dan Personalisasi: <a href="https://www.intresno.com/">Intresno</a> menawarkan berbagai pilihan desain yang elegan dan memungkinkan pasangan untuk menyesuaikan undangan mereka sesuai dengan tema pernikahan dan gaya pribadi mereka.</li><li>Notifikasi Real-Time: <a href="https://www.intresno.com/">Intresno</a> memungkinkan pasangan untuk melacak konfirmasi kehadiran tamu secara real-time. Fitur ini sangat membantu dalam perencanaan acara dan alokasi tempat duduk.</li><li>Ekonomis: Dibandingkan dengan undangan fisik, undangan digital dengan <a href="https://www.intresno.com/">Intresno</a> dapat mengurangi biaya cetak dan pengiriman yang seringkali mahal.</li></ol><h3>Bagaimana Cara Menggunakan Intresno?</h3><ol><li>Mendaftar: Pasangan dapat mendaftar ke platform <a href="https://www.intresno.com/">Intresno</a> secara gratis dan dengan mudah.</li><li>Pilih Desain: Temukan desain yang sesuai dengan tema pernikahan Anda dari berbagai opsi yang disediakan.</li><li>Personalisasi: Sesuaikan undangan Anda dengan menambahkan informasi pribadi, tanggal, waktu, dan lokasi acara pernikahan.</li><li>Bagikan Undangan: Kirim undangan pernikahan digital Anda melalui email, media sosial, atau tautan unik yang disediakan oleh <a href="https://www.intresno.com/">Intresno</a>.</li><li>Pantau Respon: Pantau konfirmasi kehadiran dan tanggapan tamu secara langsung melalui dashboard <a href="https://www.intresno.com/">Intresno</a>.</li></ol><p>Dengan memilih <a href="https://www.intresno.com/">Intresno</a>, pasangan dapat merayakan hari pernikahan mereka dengan cara yang ramah lingkungan dan efisien. Sebagai platform inovatif, <a href="https://www.intresno.com/">Intresno</a> memberikan kemudahan tanpa mengorbankan keindahan dan keunikan dalam setiap undangan pernikahan digital yang dibuatnya. Ini adalah langkah besar menuju masa depan pernikahan yang lebih modern dan berkelanjutan.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fd8e9ddbf98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pentingnya Pendekatan Persuasif disebuah Digital Agency]]></title>
            <link>https://masitings.medium.com/pentingnya-pendekatan-persuasif-di-sebuah-digital-agency-cfd0b5317e6a?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfd0b5317e6a</guid>
            <category><![CDATA[agency]]></category>
            <category><![CDATA[digital-agency]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Wed, 21 Jun 2023 05:19:40 GMT</pubDate>
            <atom:updated>2023-06-21T05:22:32.221Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*1Gnpo91MXFLydBsM" /><figcaption>Unsplash</figcaption></figure><p>Dalam dunia <em>digital</em> yang semakin berkembang pesat, persaingan di antara digital agency semakin ketat. Untuk bisa menonjol dan mendapatkan klien yang loyal, penting bagi sebuah digital agency untuk mengadopsi pendekatan persuasif yang efektif. Pendekatan persuasif ini akan membantu mereka mempengaruhi calon klien, membangun kepercayaan, dan menghasilkan hasil yang lebih baik dalam upaya pemasaran digital.</p><p><strong>Apa itu pendekatan persuasif</strong>?</p><blockquote>Pendekatan <strong>persuasif</strong> adalah suatu strategi komunikasi yang bertujuan untuk mengubah sikap, keyakinan, atau perilaku seseorang melalui penggunaan argumen, bukti, atau teknik persuasif lainnya. Dalam konteks digital agency, pendekatan persuasif melibatkan kemampuan untuk meyakinkan calon klien tentang nilai dan manfaat yang ditawarkan oleh agency tersebut.</blockquote><p>Mengapa pendekatan persuasif penting bagi <strong><em>Digital Agency</em></strong>?</p><ol><li><strong>Membangun kepercayaan dan kredibilitas</strong>: Dalam dunia <em>digital</em>, kepercayaan adalah faktor kunci dalam membangun hubungan jangka panjang dengan klien. Pendekatan persuasif yang baik akan membantu digital agency untuk mengkomunikasikan keahlian, pengalaman, dan rekam jejak yang relevan. Dengan memberikan bukti yang kuat dan meyakinkan, agency dapat membangun kredibilitas yang tinggi di mata calon klien.</li><li><strong>Menghadapi ketidakpastian</strong>: Dalam banyak kasus, calon klien mungkin masih ragu-ragu atau tidak yakin mengenai strategi pemasaran digital yang akan diimplementasikan oleh sebuah agency. Pendekatan persuasif yang baik akan membantu mengatasi ketidakpastian tersebut dengan memberikan penjelasan yang jelas dan alasan kuat mengapa strategi yang ditawarkan akan efektif dan menguntungkan bagi bisnis calon klien.</li><li><strong>Mengarahkan calon klien ke tindakan yang diinginkan</strong>: Pendekatan persuasif yang efektif dapat membantu dalam mengarahkan calon klien untuk mengambil tindakan yang diinginkan. Misalnya, mengisi formulir kontak, memulai proyek, atau membeli layanan yang ditawarkan oleh digital agency. Dengan menggunakan argumen yang persuasif dan menggambarkan manfaat yang diperoleh, calon klien akan lebih cenderung untuk mengambil langkah-langkah tersebut.</li><li><strong>Menghasilkan hasil yang lebih baik</strong>: Pendekatan persuasif yang baik dapat membantu digital agency untuk menghasilkan hasil yang lebih baik dalam kampanye pemasaran digital. Ketika calon klien yakin dan percaya pada strategi yang ditawarkan, mereka akan lebih terbuka untuk bekerja sama dengan agency dan mengikuti rekomendasi yang diberikan. Ini akan meningkatkan peluang kesuksesan dalam mencapai tujuan pemasaran yang telah ditetapkan.</li></ol><p>Tips untuk mengadopsi pendekatan persuasif di digital agency:</p><ol><li><strong>Mengenali audiens target</strong>: Penting untuk memahami audiens target dengan baik. Dengan mengetahui kebutuhan, masalah, dan preferensi calon klien, digital agency dapat menyusun pesan persuasif yang sesuai dan relevan.</li><li><strong>Memberikan bukti yang kuat</strong>: Dukung klaim dan tawaran agency dengan bukti yang konkret, seperti studi kasus, testimonial, atau data yang relevan. Ini akan membantu membangun kepercayaan dan meyakinkan calon klien tentang kemampuan dan hasil yang mungkin dicapai.</li><li><strong>Gunakan bahasa yang persuasif</strong>: Pilih kata-kata dengan hati-hati dan gunakan bahasa yang persuasif untuk mengkomunikasikan nilai dan manfaat yang ditawarkan oleh agency. Teknik seperti penggunaan kekuatan kata-kata, membangkitkan emosi, atau menyajikan keuntungan yang spesifik dapat meningkatkan daya persuasif pesan.</li><li><strong>Memberika pemahaman yang jelas</strong>: Pastikan calon klien memahami dengan jelas apa yang mereka dapatkan dari layanan atau strategi yang ditawarkan. Jelaskan dengan rinci langkah-langkah yang akan diambil dan manfaat yang akan mereka peroleh.</li><li><strong>Menjaga sikap positif</strong>: Pendekatan persuasif harus dilakukan dengan sikap yang positif dan menghargai. Hindari tekanan berlebihan atau manipulasi yang dapat merusak hubungan jangka panjang dengan calon klien.</li></ol><p>Dalam dunia digital yang semakin kompleks dan kompetitif, penting bagi sebuah digital agency untuk mengadopsi pendekatan persuasif yang efektif. Dengan membangun kepercayaan, mengatasi ketidakpastian, mengarahkan tindakan yang diinginkan, dan menghasilkan hasil yang lebih baik, pendekatan persuasif akan menjadi alat yang berharga dalam meraih kesuksesan dalam pemasaran digital.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfd0b5317e6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel : Login & Register User using Metamask on REST API]]></title>
            <link>https://masitings.medium.com/laravel-login-register-user-using-metamask-on-rest-api-ed829d9c2eed?source=rss-dbff2669c35d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed829d9c2eed</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[metamask]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Rafi Halilintar]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 15:25:34 GMT</pubDate>
            <atom:updated>2022-09-17T15:33:53.958Z</atom:updated>
            <content:encoded><![CDATA[<h3>Laravel : Login &amp; Register User using Metamask on REST API</h3><figure><img alt="Laravel: Authenticat User Using Metamask" src="https://cdn-images-1.medium.com/max/1024/1*trXCw81uc2eMqh8JrM_eug.png" /></figure><p>Its been quite long since Metamask has been really popular these day because of its ability that enables users to access the Web 3 ecosystem of decentralized applications (dapps). In this article i want to write down how do i manage to integrate Metamask in the Laravel project.</p><p>First thing first, we need to customize the users table and model in the default Laravel installation. This are the migration that we will use at the Users table.</p><pre>&lt;?php<br><br>use Illuminate\Database\Migrations\Migration;<br>use Illuminate\Database\Schema\Blueprint;<br>use Illuminate\Support\Facades\Schema;<br><br>return new class extends Migration<br>{<br>    /**<br>     * Run the migrations.<br>     *<br>     * @return void<br>     */<br>    public function up()<br>    {<br>        Schema::create(&#39;users&#39;, function (Blueprint $table) {<br>            $table-&gt;id();<br>            $table-&gt;string(&#39;name&#39;)-&gt;nullable();<br>            $table-&gt;string(&#39;email&#39;)-&gt;unique()-&gt;nullable();<br>            $table-&gt;timestamp(&#39;email_verified_at&#39;)-&gt;nullable();<br>            $table-&gt;string(&#39;password&#39;)-&gt;nullable();<br>            $table-&gt;string(&#39;wallet_address&#39;)-&gt;nullable()<br>            $table-&gt;rememberToken();<br>            $table-&gt;timestamps();<br>        });<br>    }<br><br>    /**<br>     * Reverse the migrations.<br>     *<br>     * @return void<br>     */<br>    public function down()<br>    {<br>        Schema::dropIfExists(&#39;users&#39;);<br>    }<br>};</pre><p>Basically we just going to make the default user attributes to null like name, email and password since we’re here going to use Metamask, we added some new attributes called “wallet_address” as a string to capture the wallet address of the users.</p><p>Next, for the model basically we just need to make the “wallet_address” fillable so it can be recoreded during the Register.</p><pre>&lt;?php<br><br>namespace App\Models;<br><br>// use Illuminate\Contracts\Auth\MustVerifyEmail;<br>use Illuminate\Database\Eloquent\Factories\HasFactory;<br>use Illuminate\Foundation\Auth\User as Authenticatable;<br>use Illuminate\Notifications\Notifiable;<br>use Laravel\Sanctum\HasApiTokens;<br><br>class User extends Authenticatable<br>{<br>    use HasFactory, HasApiTokens;<br><br>    protected $fillable = [<br>        &#39;name&#39;,<br>        &#39;email&#39;,<br>        &#39;password&#39;,<br>        &#39;wallet_address&#39;,<br>    ];<br><br>    protected $hidden = [<br>        &#39;password&#39;,<br>        &#39;remember_token&#39;,<br>    ];<br><br>    protected $casts = [<br>        &#39;email_verified_at&#39; =&gt; &#39;datetime&#39;,<br>    ];<br>}</pre><p>Next for the API authentication, we’re gonna make it real unique. Combining using Bearer Token and Nonce for authentication. The idea behind it are seems a bit complicated but i think you know what the idea is. To make it easier for you, here are some cheatsheet .</p><ul><li><strong>Nonce</strong> : Is the method for validating from Laravel to Metamask and reverse after confirm the signature.</li><li><strong>Bearer Token</strong> : Is the token after user succcessfully authenticate to our application using Metamask.</li></ul><p>So now, lets create a new controller and in this part lets called it <strong>AuthController.php </strong>inside the <strong>Api </strong>directory on the Controllers.</p><pre>&lt;?php<br><br>namespace App\Http\Controllers\Api;<br><br>use App\Http\Controllers\Controller;<br>use Illuminate\Http\Request;<br><br>class AuthController extends Controller<br>{<br>    public function register(Request $request)<br>    {<br>        // The register method are here.<br>    }<br><br>    public function login(Request $request)<br>    {<br>        // The login method are here<br>    }<br>}</pre><p>After that, we need to install some package to make and verify the signature from the Metamask. This package are to generate SHA-3 or Keccak in our project.</p><pre>composer require kornrunner/keccak</pre><p>After that, we also need to install Javascript ECC library in our project. There are package for doing this, so we don’t need to bother for creating from the first.</p><pre>composer require simplito/elliptic-php</pre><p>I believe since this post are fresh, you guys still can install that package in Laravel 9 at the moment.</p><p>Lets spice things up by creating a new model to store the Nonce once its been called on on the first time the user hit Login/Register. We’re going to make a new model called <strong>Nonce.php </strong>to do that, we’re going to use artisan command in our root project directory.</p><pre>php artisan make:model Nonce -m</pre><p>Now, we’re going to edit that migration file since we’re using <strong>-m </strong>argument while we’re creating the model before.</p><pre>&lt;?php<br><br>use Illuminate\Database\Migrations\Migration;<br>use Illuminate\Database\Schema\Blueprint;<br>use Illuminate\Support\Facades\Schema;<br><br>return new class extends Migration<br>{<br>    /**<br>     * Run the migrations.<br>     *<br>     * @return void<br>     */<br>    public function up()<br>    {<br>        Schema::create(&#39;nonces&#39;, function (Blueprint $table) {<br>            $table-&gt;id();<br>            $table-&gt;longText(&#39;nonce&#39;);<br>            $table-&gt;longText(&#39;content&#39;);<br>            $table-&gt;enum(&#39;type&#39;, [&#39;register&#39;, &#39;login&#39;])-&gt;default(&#39;login&#39;);<br>            $table-&gt;timestamps();<br>        });<br>    }<br><br>    /**<br>     * Reverse the migrations.<br>     *<br>     * @return void<br>     */<br>    public function down()<br>    {<br>        Schema::dropIfExists(&#39;nonces&#39;);<br>    }<br>};</pre><p>And for the model, we just put the fillable variable in there.</p><pre>&lt;?php<br><br>namespace App\Models;<br><br>use Illuminate\Database\Eloquent\Factories\HasFactory;<br>use Illuminate\Database\Eloquent\Model;<br><br>class Nonce extends Model<br>{<br>    use HasFactory;<br><br>    protected $fillable = [<br>        &#39;nonce&#39;, &#39;content&#39;, &#39;type&#39;<br>    ];<br>}</pre><p>Now, we have all we need to do the Login or Register thing inside our application. Lets edit the <strong>AuthController.php</strong> that we’ve created earlier.</p><pre>&lt;?php<br><br>namespace App\Http\Controllers\Api;<br><br>use App\Http\Controllers\Controller;<br>use Illuminate\Http\Request;<br>use App\Models\Nonce;<br>use Illuminate\Support\Facades\Hash;</pre><pre>class AuthController extends Controller<br>{<br>    public function nonce(Request $request, $type = &#39;register&#39;)<br>    {<br>        if ($type === &#39;register&#39;) {<br>            $slug = $request-&gt;wallet_address.&#39;-register-&#39;.str_slug(env(&#39;APP_KEY&#39;));<br>            $tp = &#39;register&#39;;<br>        } else {<br>            $slug = $request-&gt;wallet_address.&#39;-login-&#39;.str_slug(env(&#39;APP_KEY&#39;));<br>            $tp = &#39;login&#39;;<br>        }<br>        $make = Hash::make($slug);<br>        $nonce = Nonce::create([<br>            &#39;nonce&#39; =&gt; $make,<br>            &#39;content&#39; =&gt; $slug,<br>            &#39;type&#39; =&gt; $tp<br>        ]);<br>        if ($nonce) {<br>            return response()-&gt;json([<br>                &#39;nonce&#39; =&gt; $nonce-&gt;nonce,<br>            ])<br>        }<br>    }</pre><pre>    public function register(Request $request)<br>    {<br>        // The register method are here.<br>    }<br><br>    public function login(Request $request)<br>    {<br>        // The login method are here<br>    }<br>}</pre><p>We’re gonna make the nonce are a bit unique by combining the <strong>APP_ENV</strong> variable in the <strong>.env</strong> file, the type of authentication and the wallet address of the user. We also <strong>Hash</strong> it using Laravel facades so the user will not going to able guessing what the nonce is about. And we stored that in our <strong>Nonce</strong> model that we have created before.</p><p>After that, lets edit that file again and put the verifySignature function in order for our Login and Register function able to verify the Nonce we’ve create.</p><pre>&lt;?php<br><br>namespace App\Http\Controllers\Api;<br><br>use App\Http\Controllers\Controller;<br>use Illuminate\Http\Request;<br>use App\Models\Nonce;<br>use Illuminate\Support\Facades\Hash;<br>use kornrunner\Keccak;</pre><pre>class AuthController extends Controller<br>{<br>    public function nonce(Request $request, $type = &#39;register&#39;)<br>    {<br>        if ($type === &#39;register&#39;) {<br>            $slug = $request-&gt;wallet_address.&#39;-register-&#39;.str_slug(env(&#39;APP_KEY&#39;));<br>            $tp = &#39;register&#39;;<br>        } else {<br>            $slug = $request-&gt;wallet_address.&#39;-login-&#39;.str_slug(env(&#39;APP_KEY&#39;));<br>            $tp = &#39;login&#39;;<br>        }<br>        $make = Hash::make($slug);<br>        $nonce = Nonce::create([<br>            &#39;nonce&#39; =&gt; $make,<br>            &#39;content&#39; =&gt; $slug,<br>            &#39;type&#39; =&gt; $tp<br>        ]);<br>        if ($nonce) {<br>            return response()-&gt;json([<br>                &#39;nonce&#39; =&gt; $nonce-&gt;nonce,<br>            ])<br>        }<br>    }</pre><pre>    public function verifySignature($signature, $address, $type = &#39;register&#39;)<br>    {<br>        $content = $address.&#39;-&#39;.$type.&#39;-&#39;.str_slug(env(&#39;APP_KEY&#39;));<br>        $nonce = Nonce::where(&#39;content&#39;, $content)-&gt;where(&#39;type&#39;, $type)-&gt;latest()-&gt;first();<br>        if ($nonce) {<br>            $hash = Keccak::hash(sprintf(&quot;\x19Ethereum Signed Message:\n%s%s&quot;, strlen($nonce-&gt;nonce), $nonce-&gt;nonce), 256);<br>            $sign = [<br>                &#39;r&#39; =&gt; substr($signature, 2, 64),<br>                &#39;s&#39; =&gt; substr($signature, 66, 64),<br>            ];<br>            $recid = ord(hex2bin(substr($signature, 130, 2))) - 27;<br><br>            if ($recid != ($recid &amp; 1)) {<br>                return false;<br>            }<br><br>            $pubkey = (new EC(&#39;secp256k1&#39;))-&gt;recoverPubKey($hash, $sign, $recid);<br>            $derived_address = &#39;0x&#39; . substr(Keccak::hash(substr(hex2bin($pubkey-&gt;encode(&#39;hex&#39;)), 1), 256), 24);<br>            $nonce-&gt;delete();<br>            return (Str::lower($address) === $derived_address);<br>        }<br>    }</pre><pre>    public function register(Request $request)<br>    {<br>        // The register method are here.<br>    }<br><br>    public function login(Request $request)<br>    {<br>        // The login method are here<br>    }<br>}</pre><p>In the <strong>verifySignature </strong>function, we’re gonna search the nonce by passing the address, the type of authentication and the signature using the package that we’ve installed before (Keccak and Javascript ECC ). The idea behind it, we’re going to match the data that we have on the Nonce was it exists in our end or not. If its exists and the value hashed of the Signature was the same, then we’re going to send <strong>TRUE</strong>. if its not match, then we send it <strong>FALSE.</strong></p><p>Next, we’re going to edit our Login and Register function can able to verify it before it registered or logged in the user.</p><pre>&lt;?php<br><br>namespace App\Http\Controllers\Api;<br><br>use App\Http\Controllers\Controller;<br>use Illuminate\Http\Request;<br>use App\Models\Nonce;<br>use Illuminate\Support\Facades\Hash;<br>use kornrunner\Keccak;<br>use Illuminate\Support\Str;<br>use Elliptic\EC;<br>use App\Models\User;</pre><pre>class AuthController extends Controller<br>{<br>    public function nonce(Request $request, $type = &#39;register&#39;)<br>    {<br>        if ($type === &#39;register&#39;) {<br>            $slug = $request-&gt;wallet_address.&#39;-register-&#39;.str_slug(env(&#39;APP_KEY&#39;));<br>            $tp = &#39;register&#39;;<br>        } else {<br>            $slug = $request-&gt;wallet_address.&#39;-login-&#39;.str_slug(env(&#39;APP_KEY&#39;));<br>            $tp = &#39;login&#39;;<br>        }<br>        $make = Hash::make($slug);<br>        $nonce = Nonce::create([<br>            &#39;nonce&#39; =&gt; $make,<br>            &#39;content&#39; =&gt; $slug,<br>            &#39;type&#39; =&gt; $tp<br>        ]);<br>        if ($nonce) {<br>            return response()-&gt;json([<br>                &#39;nonce&#39; =&gt; $nonce-&gt;nonce,<br>            ])<br>        }<br>    }</pre><pre>    public function verifySignature($signature, $address, $type = &#39;register&#39;)<br>    {<br>        $content = $address.&#39;-&#39;.$type.&#39;-&#39;.str_slug(env(&#39;APP_KEY&#39;));<br>        $nonce = Nonce::where(&#39;content&#39;, $content)-&gt;where(&#39;type&#39;, $type)-&gt;latest()-&gt;first();<br>        if ($nonce) {<br>            $hash = Keccak::hash(sprintf(&quot;\x19Ethereum Signed Message:\n%s%s&quot;, strlen($nonce-&gt;nonce), $nonce-&gt;nonce), 256);<br>            $sign = [<br>                &#39;r&#39; =&gt; substr($signature, 2, 64),<br>                &#39;s&#39; =&gt; substr($signature, 66, 64),<br>            ];<br>            $recid = ord(hex2bin(substr($signature, 130, 2))) - 27;<br><br>            if ($recid != ($recid &amp; 1)) {<br>                return false;<br>            }<br><br>            $pubkey = (new EC(&#39;secp256k1&#39;))-&gt;recoverPubKey($hash, $sign, $recid);<br>            $derived_address = &#39;0x&#39; . substr(Keccak::hash(substr(hex2bin($pubkey-&gt;encode(&#39;hex&#39;)), 1), 256), 24);<br>            $nonce-&gt;delete();<br>            return (Str::lower($address) === $derived_address);<br>        }<br>    }</pre><pre>    public function register(RegisterRequest $request)<br>    {<br>        $verify = $this-&gt;verifySignature($request-&gt;signature, $request-&gt;wallet_address, &#39;register&#39;);<br>        if ($verify) {<br>            $user = User::create([<br>                &#39;wallet_address&#39; =&gt; $request-&gt;wallet_address<br>            ]);<br>            $token = $user-&gt;createToken(&#39;api&#39;)-&gt;plainTextToken;<br>            return $this-&gt;success_response([<br>                &#39;message&#39; =&gt; &#39;Registration successful&#39;,<br>                &#39;token&#39; =&gt; $token,<br>                &#39;address&#39; =&gt; $request-&gt;wallet_address,<br>            ]);<br>        } else {<br>            Nonce::where(&#39;content&#39;, $request-&gt;address.&#39;-register&#39;)-&gt;where(&#39;type&#39;, &#39;register&#39;)-&gt;delete();<br>            return response()-&gt;json([<br>               &#39;message&#39; =&gt; &#39;Invalid address or signature&#39;<br>            ], 400);<br>        }<br>    }<br><br>    public function login(Request $request)<br>    {<br>        $verify = $this-&gt;verifySignature($request-&gt;signature, $request-&gt;wallet_address, &#39;login&#39;);<br>        if ($verify) {<br>            $user = User::where(&#39;wallet_address&#39;, $request-&gt;wallet_address)-&gt;first();<br>            if ($user) {<br>                $token = $user-&gt;createToken(&#39;api&#39;)-&gt;plainTextToken;<br>                return response()-&gt;json([<br>                    &#39;message&#39; =&gt; &#39;Login successful&#39;,<br>                    &#39;token&#39; =&gt; $token,<br>                    &#39;address&#39; =&gt; $request-&gt;wallet_address,<br>                ]);<br>            }<br>        } else {<br>            Nonce::where(&#39;content&#39;, $request-&gt;address.&#39;-register&#39;)-&gt;where(&#39;type&#39;, &#39;register&#39;)-&gt;delete();<br>            return response()-&gt;json([<br>               &#39;message&#39; =&gt; &#39;There is no user with that wallet address&#39;<br>            ], 400);<br>        }<br>    }<br>}</pre><p>There you go, we half to the end of this article. Now lets add our controller in the <strong>api.php </strong>route.</p><pre>&lt;?php<br><br>use Illuminate\Support\Facades\Route;<br><br>/*<br>|--------------------------------------------------------------------------<br>| API Routes<br>|--------------------------------------------------------------------------<br>|<br>| Here is where you can register API routes for your application. These<br>| routes are loaded by the RouteServiceProvider within a group which<br>| is assigned the &quot;api&quot; middleware group. Enjoy building your API!<br>|<br>*/<br><br>Route::prefix(&#39;auth&#39;)-&gt;group(function () {<br>    Route::post(&#39;/register&#39;, [\App\Http\Controllers\Api\AuthController::class, &#39;register&#39;]);<br>    Route::post(&#39;/login&#39;, [\App\Http\Controllers\Api\AuthController::class, &#39;login&#39;]);<br><br>    Route::get(&#39;/nonce/{type?}&#39;, [\App\Http\Controllers\Api\AuthController::class, &#39;nonce&#39;]);<br>});</pre><p>And for the sake of testing purposes, we’re going to create a new view. Lets called it <strong>auth3.blade.php</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;<br>    &lt;title&gt;MetaMask Login&lt;/title&gt;<br>    &lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot; integrity=&quot;sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3&quot; crossorigin=&quot;anonymous&quot;&gt;<br>    &lt;script src=&quot;https://cdn.ethers.io/lib/ethers-5.2.umd.min.js&quot;&gt;&lt;/script&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;div class=&quot;container&quot;&gt;<br>    &lt;div class=&quot;row&quot;&gt;<br>        &lt;div class=&quot;col-12 text-center mt-10&quot;&gt;<br>            &lt;h1&gt;Login with Metamask&lt;/h1&gt;<br>            &lt;button class=&quot;btn btn-primary mt-5&quot; onclick=&quot;web3Register();&quot;&gt;Register with MetaMask&lt;/button&gt;<br>            &lt;button class=&quot;btn btn-primary mt-5&quot; onclick=&quot;web3Login();&quot;&gt;Login with MetaMask&lt;/button&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;<br>&lt;script&gt;<br>    async function authHandler(type)<br>    {<br>        if (!window.ethereum) {<br>            alert(&#39;MetaMask not detected. Please install MetaMask first.&#39;);<br>            return;<br>        }<br><br>        const provider = new ethers.providers.Web3Provider(window.ethereum);<br><br>        try {<br>            await provider.send(&quot;eth_requestAccounts&quot;, []);<br>            const address = await provider.getSigner().getAddress();<br><br>            let response = await fetch(&#39;{{ url(https://medium.com/&#39;/api/auth/nonce/&#39;) }}/&#39;+type+&#39;?wallet_address=&#39; + address);<br><br>            const json = await response.json();<br>            const message = json.data.nonce;<br><br>            const signature = await provider.getSigner().signMessage(message);<br>            console.log(signature);<br><br>            response = await fetch(&#39;{{ url(https://medium.com/&#39;/api/auth/&#39;) }}/&#39; + type, {<br>                method: &#39;POST&#39;,<br>                headers: {<br>                    &#39;Content-Type&#39;: &#39;application/json&#39;<br>                },<br>                body: JSON.stringify({<br>                    &#39;wallet_address&#39;: address,<br>                    &#39;signature&#39;: signature,<br>                })<br>            });<br>            if (response.status == 200) {<br>                const data = await response.json();<br>                console.log(data);<br>            }<br>        } catch (err) {<br>            console.log(&#39;Error : &#39; + err.code);<br>        }<br>    }<br><br>    async function web3Login() {<br>        await authHandler(&#39;login&#39;);<br>    }<br>    async function web3Register() {<br>        await authHandler(&#39;register&#39;);<br>    }<br>&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>All of those endpoint are get from the route API that we’ve define earlier. So i think you know the rough idea how to do the Authentication in Laravel using Metamask. I think you know how to add the things for that view above able to see in your end tho.</p><blockquote>Note : You may need to delete the Nonce once a daily to prevent junk data inside your database.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed829d9c2eed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>