Snippets

Random numbers and bytes with PHP7

Playing
Random numbers and bytes with PHP7
5 mins8 years ago

Forget the methods you've used before to generate random numbers and strings. PHP7 now supports it out the box!

Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Comments

No comments, yet. Be the first to leave a comment.

Suggested courses

PHP

Multiple Drag And Drop File Uploading and Processing with Inertia

Build a multiple file chunked uploader in Inertia with the ability to pause, resume and cancel uploads. We’ll also be able to edit metadata (like the title and description) for each upload — even while they’re uploading and processing. In the second half of the course, we’ll learn how to queue and process uploaded files on the backend (like encoding videos), and in realtime, report back to the client with progress updates using WebSockets. It’s everything you need to know to upload and process large files in Inertia.

17 episodes
1 hr 56 mins
PHP

Build a Starter Kit With Inertia and Fortify

Let’s build our own Laravel starter kit with Inertia and include all the features you’d expect. We’ll implement authentication, email verification, profile photo uploads, two factor authentication, and more. Fortify is a frontend agnostic authentication package for Laravel, meaning most of the work is done for us — we just need to build the frontend and make requests to the endpoints that Fortify registers. Once you’re done, you’ll have a clean slate for building your next project, with the ability to control everything in your own starter kit.

40 episodes
5 hrs 21 mins
PHP

Create an AI chat bot with Livewire and ChatGPT

Let’s learn how wire:stream can help us stream ChatGPT responses as they arrive, by building a chat interface with Livewire. Each message we send and receive will be shown in chat history. It even remembers the conversation context. Sure, there are a ton of ChatGPT wrappers out there, but by the end of this course, you’ll have wire:stream in your toolkit for future projects.

6 episodes
29 mins
PHP

Build a URL Shortener with Volt and Folio

Volt is a functional API for Livewire that allows you to build Livewire components in a single file, alongside Blade templates. Pairing this with automatic route creation using Laravel Folio gives us a serious productivity boost. So, let’s build a URL shortener while learning how Volt and Folio work!

10 episodes
53 mins
PHP

Drag and Drop Sorting With Livewire

Easily add drag and drop sorting functionality to your Livewire components with an Alpine directive, powered by Sortable.js. We’ll start with a list of ordered items, activate drag and drop sorting, and then feed the new order back to Livewire to instantly update the database. Once you’re done, you’ll be able to reuse this functionality in any of your Livewire components.

6 episodes
22 mins