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

Dotdev.co:
Writing advanced Eloquent search query filters
Jun 15, 2016 @ 16:10:04

In a new post from the Dotdev.co site there's a tutorial from Amo Chohan helping you write advanced search query filters for Eloquent in your Laravel application.

I recently needed to implement a search feature in an events management project I was building. What begun as a few simple options (searching by name, e-mail etc), turned into a pretty large set of parameters.

Today, I’ll go over the process I went through and how I built a flexible and scalable search system. For those of you who are eager to see the final code, head over to the Git repository to see the code.

He starts off by outlining what he'll be creating and where the need comes from for this more advanced filtering. He uses a company-wide calendar example with events and meetings/clients shown for all users. He defines the filters he knows he'll want to search by and the models relating to the data needed for those queries. He then spends the rest of the post going through the code needed to implement the filtering, starting with a rough (but working) version and refactoring from there. He moves away from the procedural method of applying filters to a query object directly and over to "applying" them more dynamically using a set of filter instances via a Decorator design pattern approach.

tagged: advanced eloquent filter search decorator apply refactor tutorial

Link: https://dotdev.co/writing-advanced-eloquent-search-query-filters-de8b6c2598db#.16sfoe3a8

NetTuts.com:
PSR-Duh!
Apr 12, 2013 @ 15:46:26

On NetTuts.com today there's a post that talks about applying the PSR formatting to your application's code. If you haven't already read their introduction to the PSRs, it's highly suggested.

In a previous lesson here on Nettuts+, you learn about PSR; however, that article didn’t detail the process of integrating that coding style into your projects. Let’s fix that!

They briefly recap the main two PSRs (PSR-1 and PSR-2, but no mention of PSR-3 the logging interface) and show code examples of them being applied. They also point to the PHP_CodeSniffer tool that you can use to keep your code in the correct structure. Instructions are included to install it specifically for the Sublime Text 2 editor via package control. It's just a command-line tool, though, so it could be integrated with just about any other editor/IDE out there too.

tagged: psr psr1 psr2 apply autoload formatting phpcodesniffer

Link: http://net.tutsplus.com/tutorials/tools-and-tips/psr-duh

Bradley Holt's Blog:
The Twelve-Factor App Applied to PHP
Nov 30, 2011 @ 16:14:49

Recently a site called The Twelve Factor App surfaced as a guideline for web applications to be at their best. Bradley Holt has taken these suggestions and has applied them to PHP applications in a few quick comments to each point.

If you develop web apps, I encourage you to check out The Twelve-Factor App. This is an excellent resource for anyone building and deploying software-as-a-service. PHP has great support for many of the twelve-factors. I want to take a look at specifically how each factor may be applied to a PHP application.

Some of the points the Twelve-Factor App makes aren't entirely relevant to PHP (like "Backing Services") but Bradley gets into details on others, providing technology that can be used to fill the need.

tagged: twelvefactorapp apply webapplication suggestion

Link:

Stoyan Stefanov's Blog:
Image fun with PHP - part 2
Nov 13, 2007 @ 18:56:00

SToyan Stefanov has posted some examples of what sort of output can be made with the imagefilter function in PHP.

Here's the list of filters he applies:

  • Brightness
  • Grayscale
  • Contrast
  • Colorize
  • Edge Detect
  • Emboss
  • Gaussian Blur
  • Selective Blur
  • Mean Removal
  • Smooth
  • Negate

And, as a sort of a bonus, he includes a lazy way to make your image look like it's sepia toned.

tagged: image fun filter apply example sepia image fun filter apply example sepia

Link:

Stoyan Stefanov's Blog:
Image fun with PHP - part 2
Nov 13, 2007 @ 18:56:00

SToyan Stefanov has posted some examples of what sort of output can be made with the imagefilter function in PHP.

Here's the list of filters he applies:

  • Brightness
  • Grayscale
  • Contrast
  • Colorize
  • Edge Detect
  • Emboss
  • Gaussian Blur
  • Selective Blur
  • Mean Removal
  • Smooth
  • Negate

And, as a sort of a bonus, he includes a lazy way to make your image look like it's sepia toned.

tagged: image fun filter apply example sepia image fun filter apply example sepia

Link:


Trending Topics: