Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
Quickly Build a PHP CRUD Interface With the PDO Advanced CRUD Generator Tool
Dec 18, 2018 @ 19:04:41

On the TutsPlus.com site they've posted a tutorial showing you how to use a CRUD generator tool to automatically generate some of the create, read, update, and delete functionality for your application.

In this article, we’re going to review PDO CRUD - a form builder and database management tool. PDO CRUD helps you build forms for your database tables with just a few lines of code, making it quick and easy to bootstrap a database application.

[...] Today, we’re going to discuss the PDO CRUD tool, available at Code Canyon for purchase at a very reasonable price. It’s a complete CRUD builder tool which allows you to build applications by just providing database tables and by writing a few lines of code.

It works with multiple database back-ends, including MySQL, Postgres and SQLite. In this article, we’ll see how to use PDO CRUD to build a CRUD system with the MySQL database back-end.

They then walk you through the installation and configuration of the tool, defining options about the host, username, and password for the database. It then helps you create two tables that will be used as sources: employee and department. Once these are defined, you can then use the web frontend to perform CRUD operations on these tables without having to write any custom code. It also lists out some of the additional features including searching, pagination and bulk export.

The post goes on to talk about how to make modifications to how the system works with the data in the tables (like field types), creating join views and customizing the options for other tool features.

tagged: crud interface tutorial pdo advanced generator

Link: https://code.tutsplus.com/tutorials/quickly-build-a-php-crud---interface-with-the-pdo-advanced-crud-generator-tool--cms-32367

TutsPlus.com:
Get Started With CRUD Operations in PHP MySQL Databases
Dec 07, 2018 @ 16:53:06

On the TutsPlus.com site they've posted a tutorial for those new to PHP and MySQL out there sharing the basics of CRUD operations using the built-in language functionality ("CRUD" stands for "Create, Read, Update, Delete").

In this article, we're going to explore how you could use a MySQL database to perform CRUD (create, read, update, and delete) operations with PHP. If you want to get your hands dirty with database connectivity in PHP, this article is a great starting point.

If you are just getting started with PHP, you probably realize that database connectivity is an essential feature that you'll need to get familiar with sooner or later. In most cases, a database is the backbone of any web application and holds the data of the application. So, as a PHP developer, you'll need to know how to deal with database operations.

In this article, we'll keep things simple and explore how to use the core mysqli functions. In upcoming articles of this series, we'll explore a couple of other ways to handle database connectivity.

They then walk you through some of the basics of:

  • creating the connection to the database
  • selecting information from the database
  • inserting and updating records
  • how to pull the record information
  • deleting records from the database tables

Each item on the list comes with plenty of explanation and example code to get you on the right path to learn these basic concepts.

tagged: crud operation tutorial mysql beginner create read update delete

Link: https://code.tutsplus.com/tutorials/how-to-work-with-mysql-in-php--cms-32222

Laravel News:
Testing Vue components with Laravel Dusk
Mar 14, 2018 @ 18:09:52

On the Laravel News site there's a new post showing how you can test Vue.js applications with Laravel Dusk, a testing tool created by the Laravel project to make it easier to create integration tests that are run with a ChromeDriver.

Adding tests to a project is always beneficial for different aspects, but choosing the right strategy could be a struggle for many developers.

The problem multiplies itself when you are using different tools or frameworks, and although “having as many tests as you can” sounds like a good idea, at least in theory, in practice this can be very different. The following is an interesting article from the Twitter team about their thoughts on Feature Testing.

Taylor Otwell shared Twitter’s article on his Bi-Weekly Laravel Tips newsletter, subscribe if you haven’t done yet. Let’s build a simple to-do list using Vue.js and Laravel to illustrate how to add Browser testing using Laravel dusk.

They starts with the controller code to create "tasks" functionality for read/write/update/delete that includes request validation, model binding and JSON responses. It then includes the code to create the first "task" tests for each of the CRUD operations. With those basics in place, the tutorial then gets into the Vue.js side, showing how to test a simple TasksComponent.vue file and its functionality.

tagged: laravel dusk testing crud task vuejs tutorial

Link: https://laravel-news.com/testing-vue-components-with-laravel-dusk

Twilio Blog:
Google Spreadsheets and PHP
Mar 08, 2017 @ 15:48:31

On the Twilio blog they've posted an article from Matt Stauffer looking at the combination of Google Sheets and PHP to perform some of the normal CRUD (create, read, update, delete) operations via the Google Sheets API.

Have you ever needed to pull some data from a Google Spreadsheet? My default in the past would be to export the data and upload it to the app directly, but it turns out it’s not very difficult to read directly from Google Spreadsheets using the Google Drive API.

In this tutorial, we’ll read, write, update, and delete data from a Google Spreadsheet with just a few lines of PHP.

He clones an example spreadsheet to use in the tutorial and shows how to prepare it for programatic access (basically exposing it for use). He then gets to work using the google/apiclient and asimlqt/php-google-spreadsheet-client packages to connect to and work with the API. He includes the code to:

  • connect to the API and get a usable token
  • pull data from the sheet by title
  • update individual cells data
  • updating entire rows
  • deleting rows
  • insert new rows

You'll need to be a bit familiar with how the Google API Console works to get things set up, but there's an animation that helps walk you through some of it.

tagged: google sheets tutorial package api crud operation console

Link: https://www.twilio.com/blog/2017/03/google-spreadsheets-and-php.html

SitePoint PHP Blog:
Build Your Own Dropbox Client with the Dropbox API
Nov 04, 2016 @ 14:36:55

On the SitePoint PHP blog there's a new tutorial posted by author Wern Ancheta showing you how to make your own DropBox client with the help of a bit of PHP and the DropBox API.

There are lots of file hosting solutions out there, but few things compare to Dropbox because of its simplicity, auto-sync feature, cross-platform support and other cool features.

As a PHP developer you can even take advantage of their API in order to create apps that use its full capabilities. In this article, you’ll learn how to build one such app to perform different operations in a user’s Dropbox account. You will be using the Dropbox API version 2 in this tutorial. If you want to follow along, you can clone the project from Github.

They start off by walking you through the creation of an application on the DropBox side (required to connect to the API) and how to get its credentials (complete with screenshots). With that set up they get into the application - a simple Laravel-based setup that lets you connect to your account and get information like current file lists, user info and even upload new files. The tutorial includes all of the code for the controllers, models, views, routes, etc. you'll need to make it all work. There's even search functionality letting you look through current files/folders and locate certain items.

tagged: dropbox client api tutorial laravel application upload search list crud

Link: https://www.sitepoint.com/build-your-own-dropbox-client-with-the-dropbox-api/

SitePoint PHP Blog:
A First Look at Atlas – the ORM That Delivers
Oct 17, 2016 @ 20:16:33

The SitePoint PHP blog has posted a new tutorial focusing on the Atlas ORM, a recent addition to the wide range of database ORMs in the PHP ecosystem, focusing on being a mapping of your persistence model.

By definition, a Data Mapper moves data between objects and a database and isolates them from one another. With a Data Mapper, the in memory objects don’t even need to know that a database exists. It does not need to know the SQL interface or database schema; it doesn’t even need the domain layer to know it exists!

This might lead us to thinking that, in Atlas, the persistence layer is totally disconnected from the database, but that is not quite what happens. [...] An Atlas Record is passive; not an active record. Unlike most ORMs, its objects represent the persistence model, not the domain model. Think of it as representing how the data is stored and not as real world representations.

The tutorial goes on to talk about some of the background behind the package being developed and some of its core principles. They then walk you through the installation of the package, doing a bit of related database setup and the code to perform some basic CRUD (create, read, update, delete) operations on the tables. This is followed by a few more practical examples and a few caveats for the library's use.

tagged: atlas orm database tutorial example crud operation

Link: https://www.sitepoint.com/a-first-look-at-atlas-the-orm-that-delivers/

SitePoint PHP Blog:
A Pokemon Crash Course on CouchDB
Aug 12, 2016 @ 15:02:56

The SitePoint PHP blog has a new tutorial posted giving you a "Pokemon Crash Course" on CouchDB, the popular NoSQL database. The "Pokemon" part comes in related to the data the tutorial uses to show you common operations and the use of a PHP interface to perform them.

In this tutorial, we’ll walk through working with CouchDB, a NoSQL database from Apache. This tutorial will focus more on the practical side, so we won’t cover what CouchDB is good for, how to install it, why use it, etc. We’ll focus on how to perform database operations through CouchDB’s HTTP API and how to work with it in PHP, laying the foundation for future, more complex posts.

The article is then broken up into different sections by operation, starting with the use of the CouchDB database via a console then via PHP:

  • Creating a Database
  • Talking to the HTTP API
  • Creating New Documents
  • Bulk Insert
  • Retrieving Documents
  • Updating Documents
  • Working with PHP

Each section includes code snippets and (where relevant) screenshots of the results to help you ensure you're on the right track.

tagged: tutorial couchdb pokemon data introduction crud library example

Link: https://www.sitepoint.com/a-pokemon-crash-course-on-couchdb/

IBM Developer Blog:
Get Started With CouchDB Using PHP and Guzzle
Jul 28, 2016 @ 18:07:48

On the IBM Developer Blog they've posted a new article from Lorna Mitchell helping you get started with CouchDB and Guzzle, making use of this popular HTTP client package to interface with CouchDB's HTTP interface quickly and easily.

In today’s post, we’ll look at how we can use CouchDB in our PHP applications, using the excellent PHP HTTP library Guzzle. Guzzle is a modern, PSR-7 compliant object-oriented PHP library that handles all aspects of HTTP in a correct and — importantly, a scalable — way. So it’s a great way to add any HTTP-interfaced services into your application (PHP 5.5 and later, does support PHP 7).

She then starts off with the installation of Guzzle via Composer and some sample code to make the initial connection to the CouchDB server (either local or remote). With the connection up and working and a "welcome" banner returned, she shows some simple operations like:

  • getting a list of all databases
  • creating a new database
  • inserting and selecting data
  • updating and deleting data

Code is provided for each of these and, thankfully, Guzzle makes it a pretty simple process and handles most of the heavy lifting on the HTTP requests for you.

tagged: couchdb guzzle introduction database http install connect crud

Link: https://developer.ibm.com/clouddataservices/2016/07/27/get-started-with-couchdb-php-guzzle/

SitePoint PHP Blog:
CRUD (Create Read Update Delete) in a Laravel App
May 25, 2015 @ 14:49:11

The SitePoint PHP blog continues their series around the creation of a basic CRUD (create, read, update and delete) application with PHP. In this second part of the series they build on the simple application in the first part and enhance it with the remainder of the CRUD handling.

In the previous part, we’ve bootstrapped our Laravel CRUD application by creating the database, some controllers, basic routes and simple views. In this part, we’ll wrap things up and implement proper CRUD.

He jumps right in and creates the controller action and view to take in new "Task" information. This includes the installation of the Illuminate HTML package and setup of the needed provider and facades. He shows how to create the Task model and hook the results of the request into it and make the new record. This includes some basic "required" validation too. He then shows how to read and display the list of current tasks as well as setting up the edit and delete actions for each task.

tagged: tutorial crud application laravel series part2 model form view

Link: http://www.sitepoint.com/crud-create-read-update-delete-laravel-app/

SitePoint PHP Blog:
Bootstrapping a Laravel CRUD Project
May 21, 2015 @ 16:18:27

The SitePoint PHP blog has kicked off a new series about using the Laravel framework to create a basic CRUD application relatively easily.

In this tutorial, we’re going to build and run a simple CRUD application from scratch using Laravel 5.

The target audience for the tutorial are those completely new to the world of Laravel so they start at the beginning. He walks you through the creation of a new Laravel project and the database setup and configuration. He goes through the creation of "resourceful routing" and using the Laravel "artisan" command line tool to generate the matching controller. From there he talks about views and Blade templating followed by the creation and execution of the needed database migrations. The tutorial wraps up with a look at the model system included with Laravel and how they fit in with the Eloquent ORM.

tagged: bootstrap crud project laravel tutorial series part1 introduction

Link: http://www.sitepoint.com/bootstrapping-laravel-crud-project/


Trending Topics: