PHP Directory

Blogs

  • Building a SparkPost Client: TDD with PhpUnit and Mockery

  • Turn Your WordPress Site into More Than One Blog with the Easy Content Types Plugin

    By Elma Dilaver Gheith
    WordPress started as a blogging platform but thanks to many thousands of plugins, nowadays it can be practically anything else other than a blog.

    The custom post types feature is very powerful because it can turn what would be a blog post page into anything, as long as you know how to take advantage of it or you can use a plugin to simplify your task.

    Read this article to learn about the Easy Content Types plugin and you can use it to easily create new custom post types, taxonomies and meta boxes.
  • Never Use null

    When doing code reviews together with our customers we see a pattern regularly which I consider problematic in multiple regards – the usage of null as a valid property or return value. We can do better than this.
  • PHP Articles Report April 2016 Edition

    By Manuel Lemos
    This is the April edition of the podcast hangout recorded by Manuel Lemos and Arturs Sosins to comment on the latest outstanding PHP Articles published recently.

    They commented on articles about PHP source code protection solutions, the parallax WordPress theme, email verification solutions, PHP 7 backwards incompatible changes and new features, and fast debugging methods using PHPEd.

    Listen to the podcast, or watch the hangout video to learn more about these PHP articles.
  • Notable PHP package: Scripd

    By Manuel Lemos
    Every SQL database driven application needs to update the database schema once in a while to support new features.

    This class can perform that process of generating SQL for database updates with elegance, as it allows developers to defined database schema additions in a JSON based file format, so it can work with different types of databases.

    Since the format is based in JSON it can be used eventually by similar packages written in other languages.

    Not only it supports the creation and modification of databases, tables and indexes, but it also supports triggers, views, stored procedures and functions.

    Read this article to learn more details about how this notable PHP package works.
  • Interview with Rachel Baker

    Video

    Audio only

    The post Interview with Rachel Baker appeared first on Voices of the ElePHPant.

  • Notable PHP package: PHP Get All Words

    By Manuel Lemos
    PHP provides an extensive set of functions to manipulate text strings including several ways to split a string into its words.

    However, there is no built-in way to detect and exclude stop words.

    This class can extract the words of a text excluding stop words. I can also consider words that may appear duplicated but with different case.

    Read this article to learn more details about how this notable PHP package works.
  • Starting a Business with Laravel Spark

    I am really excited about Laravel Spark. By the time you read this, there will probably be a multitude of posts explaining how you can set it up. That's not as interesting to me as the journey I'm about to take in creating an actual business with Spark!

    The idea is simple. I have created a Pagekit module which you can use to back up and restore site data. The module makes it easy to store and download these backups, and restore them on different servers.

    The trouble is, getting those backup files to the remote server takes time and a bit of hassle. I have often wanted a way to quickly and painlessly transfer this application state from one server to another, and make automated offsite backups. So I'm going to set that up for myself, and perhaps others will find it useful enough to pay for it.

    Spark splash screen

    Getting Started

    I'm using Stripe, and intend to have a single plan with no trial. The setup for this is quite easy, but I've made a note of the plan ID. I'll need that to set the plan up in Spark...

    Stripe welcome screen

    Next, I reset my secret and public Stripe keys and update to the latest API (through the same screen, https://dashboard.stripe.com/account/apikeys).

    I forgot that the settings in .env do not automatically reload while the Laravel development server is running, so I was getting needlessly frustrated at the keys which wouldn't seem to update.

    Spark has a few expected registration/profile fields, but I want to add a few more. I would like to ask users if they would like automatic backups and I'd also like to collect their billing address, so I can show it on their invoice. First I'll have to create a migration for the new field:

    php artisan make:migration add_should_backup_field
    

    To do this, we can add the column (making sure to remove it if the migrations are rolled back):

    use Illuminate\Database\Migrations\Migration;
    use Illuminate\Database\Schema\Blueprint;
    use Illuminate\Support\Facades\Schema;
    
    class AddShouldBackupField extends Migration
    {
        public function up()
        {
            Schema::table("users", function (Blueprint $table) {
                $table->boolean("should_backup");
            });
        }
    
        public function down()
        {
            Schema::table("users", function (Blueprint $table) {
                $table->dropColumn("should_backup");
            });
        }
    }
    

    Continue reading %Starting a Business with Laravel Spark%

  • Writing SQL that works on PostgreSQL, MySQL and SQLite

  • PHP 5.5.35 Release

    The PHP development team announces the immediate availability of PHP 5.5.35. This is a security release. Several security bugs were fixed in this release. All PHP 5.5 users are encouraged to upgrade to this version. For source downloads of PHP 5.5.35 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.

:: Our Favorites

Featured Sites Using PHP

>Atlanta Real Estate