Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free

PHP posts

  • By Matthew Setter
    How to Create a Markdown Blog in PHP With the Slim Framework How to Create a Markdown Blog in PHP With the Slim Framework

    When it comes to blogging software, you're not starved for choice. However, despite this choice and how feature-rich modern blogging software is, are the available options necessarily the right choice?

    Sure, software such as WordPress, Ghost, Gatsby, and Wix are very feature-rich — and their UIs are often very smooth. But do you want the hassle of installing, configuring, and securing them on top of writing your blog content? What's more, can you justify the budget that some blogging software requires?

    Maybe, all you want to do is to write your site's content using your preferred editor, using a simple format designed for writing for the web, Markdown, rather than through a user interface.

    If that’s the case, then in this tutorial, I’m going to show you how to create a blog that draws its content from Markdown files. The blog uses the Slim Framework (version 4), the Standard PHP …

    Read More
  • By Oluyemi Olususi
    Laravelアプリケーションでリポジトリパターンを使う方法 Laravelアプリケーションでリポジトリパターンを使う方法

    この記事はOluyemi Olususiこちらで公開した記事(英語)を日本語化したものです。





    データベース関連のロジックを一箇所で管理することにより、コードの構成を整理したり、重複を避けることにもつながります。このようなメリットは小規模のプロジェクトではすぐに …

    Read More
  • By Oluyemi Olususi
    CodeIgniterとJSON Web Tokenを使用したセキュアなRESTful APIの構築方法 CodeIgniterとJSON Web Tokenを使用したセキュアなRESTful APIの構築方法

    この記事はOluyemi Olususiこちらで公開した記事(英語)を日本語化したものです。

    クラウドサービスの利用と応用が拡大する中で、Simple Object Access Protocol(SOAP)よりも効率的なアーキテクチャスタイルの必要性が増しています。REST(REpresentational State Transfer)はクライアントとApplication Programming Interface(API)との軽量でステートレスな通信を可能にします。RESTを使った通信はステートレスです。Restful APIのアクセスコントロールはトークンベースで行われ、クライアントが要求したアクションをリソースに実行する権限があるかどうかを判別する情報が伝えられます。

    本稿では、CodeIgniterを使用したRESTful APIの作成方法を紹介します。CodeIgniterは強力な機能を持つPHPフレームワークで、非常に小さなリソースでフルスケールのWebアプリケーションを構築できます。




    • Composer
    • ローカルデータベースインスタンス
      このチュートリアルではMy …
    Read More
  • By Kenneth Ekandem
    How to Create a Restful CRUD API in PHP Using Laravel and Google Firebase How to Create a Restful CRUD API in PHP Using Laravel and Google Firebase

    In this tutorial, you will learn how to create a RESTful CRUD (Create, Read, Update, and Delete) API with Laravel that stores its data in a Firebase realtime database.

    What is Firebase?

    Google Firebase is a Google-backed application development platform that enables developers to develop iOS, Android, and Web-based applications. Firebase provides tools for tracking analytics, reporting and fixing app crashes, creating marketing and product experiments, and much more.

    So, without wasting time, let us dive in.


    1. PHP 7.4, though ideally 8.1.
    2. Composer installed globally.
    3. jq.
    4. Prior experience with Laravel.
    5. A text editor such as Visual Studio Code or an IDE such as PhpStorm.
    6. A Google account.

    Install and set up the Laravel application

    To begin, you first have to install a Laravel application and run it on your local development machine.

    To do that, in your terminal, run the command …

    Read More
  • By Ijeoma Nelson
    How to Create a RESTful API in PHP With SlimPHP 4 and MySQL How to Create a Restful API With SlimPHP 4 and MySQL

    For those times when all you need is a simple solution that enables you to write quick, yet powerful applications, Slim is a great contender amongst the myriad of available PHP frameworks.

    At its core, Slim is a microframework designed to receive HTTP requests, route the requests to the relevant controllers, and return the corresponding HTTP responses.

    Slim’s minimalist environment makes it ideal for the development of both microservices and APIs that consume, repurpose, or publish data.

    In this tutorial, you’re going to learn how to create a RESTful API using Slim 4, PHP, and MySQL.


    To complete this tutorial you will need the following:

    • PHP 7.4. Ideally version 8.1.
    • Composer installed globally.
    • MySQL 8.
    • Postman.

    Let's create the API!

    To begin, you need to create the project’s root directory, named customers-api. You can do this in your editor/IDE or by running the following commands on a …

    Read More
  • By Matthew Setter
    PHPでHTTPリクエストを実行する5つの方法 PHPでHTTPリクエストを実行する5つの方法

    この記事はMatthew Setterこちらで公開した記事(英語)を日本語化したものです。

    HTTPリクエストは、特にPHPにおいて、最新のWebベースのアプリケーションを特徴付けるものです。開発者は、Google Cloud、Facebook、AWSなど、あらゆる種類の外部サービスやAPIを頻繁に操作する必要があります。極端に言えば、HTTPリクエストは、PHPの基礎の習得後に開発者が最初に学ぶことの1つになるかもしれません。少なくとも私の場合はそうでした。





    カカドゥ国立公園のイエロー・ウォーター・ビラボンに沈む夕日、オーストラリア、ノーザンテリトリー州”(Geoff Whalan氏撮影CC BY-NC-ND 2.0に基づく掲載許可)


    チュートリアルを完了するには、以下の項目が必要 …

    Read More
  • By Oluyemi Olususi
    Docker ComposeとSymfonyを使って開発してみよう Docker ComposeとSymfonyを使って開発してみよう

    この記事はOluyemi Olususiこちらで公開した記事(英語)を日本語化したものです。




    その結果、特定のエラーが発生すると、問題の原因を突き止めることが困難になります。エラーが1つのOSでのみ発生することが混乱に拍車をかける可能性もあります。開発者の間で有名なフレーズ、「It works on my machine」(私のマシンでは動作するのに)の状態につながります。




    本稿では、SymfonyプロジェクトでDockerを使用する方法について紹介します。ここでは、NginxがWebサーバーとして使用 …

    Read More
  • By Kenneth Ekandem
    How to Use Multiple Authentication Providers in Lumen How to Use Multiple Authentication Providers in Lumen

    As we all know, authentication is a very important aspect of building an application because you want to ensure that users can only access routes and information that they're allowed to.

    Authentication takes many forms and a common one is tokenization which we will be focusing on in this tutorial.

    Tokenization replaces a sensitive data element, for example, user information such as user id's, names, and emails, with a non-sensitive substitute, known as a token.

    But how will issuing tokens be beneficial to multiple authentications? Well, since every user has a unique token, and they can be stored in separate database tables, the token can be queried across these tables to find a match, and based on which return a true, the route can be limited or opened for the user.

    In this tutorial, you will learn how to use multiple authentication providers in Lumen to limit access to routes, …

    Read More
  • By Elijah Asaolu
    Passwordless Authentication With PHP Using Twilio Verify Passwordless Authentication with PHP using Twilio Verify

    Passwordless authentication refers to an authentication method that does not require a password or any other knowledge-based secret to log a user into a system. This method of authentication adopts the means of authorizing users by sending a unique, one-time code (OTP) or magic link to the user via email, push notification, or text message.

    In this article, you'll learn how the infrastructure underlying passwordless authentication works, and create a small app that uses this authentication approach.

    How it works

    Most passwordless authentication implementations have a single entry point, i.e., a single page for both new users signing up and for existing users logging in to their accounts.

    In a typical implementation, both new and existing users are asked to enter their mobile phone number during either registration or login. After verifying the mobile number, the system checks if the user is an existing one or a new one. If …

    Read More
  • By Joseph Udonsak
    A Beginner's Guide to Test Driven Development With Symfony and Codeception - Part 2 A Beginner's Guide to Test Driven Development With Symfony and Codeception - Part 2

    Hey there! Welcome back!! In the first part of this series, we took a first look at Test Driven Development (TDD) and explained the need for it. We then got hands-on by setting up a new Symfony project which used Codeception as its testing library.

    Then, we used TDD to start building a P2P (Peer-to-peer) payment application. While building the authentication functionality, we uncovered some TDD gems such as the Red-Green-Refactor cycle and Sliming.

    In this part, we'll dive back into TDD and continue building our application, implementing funds transfer functionality. While we do that, we will also see how Codeception makes provisions for us to customise our test suite to add our own helper methods and assertions.

    The functionality we will build in this series has three parts:

    1. Authentication: This feature includes login and registration.
    2. Transfers: This feature allows one registered user to send money to another registered …
    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.