Subscribe: PHPDeveloper.org
http://www.phpdeveloper.org/phpdev.rdf
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
beta  blog  code  create  data  https  laravel scout  laravel  mattermost  news  packages  search  service providers  service  site 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: PHPDeveloper.org

PHPDeveloper.org



Up-to-the Minute PHP News, views and community



Published: Fri, 21 Jul 2017 07:53:14 -0500

 



TutsPlus.com: How to Register & Use Laravel Service Providers

Thu, 20 Jul 2017 14:08:19 -0500

On the TutsPlus.com site they've posted a new tutorial showing you how to register and use service providers in Laravel and how it relates to the service container functionality.

If you've ever come across the Laravel framework, it's highly unlikely that you haven't heard of service containers and service providers. In fact, they're the backbone of the Laravel framework and do all the heavy lifting when you launch an instance of any Laravel application.

In this article, we're going to have a glimpse of what the service container is all about, and following that we'll discuss the service provider in detail. In the course of this article, I'll also demonstrate how to create a custom service provider in Laravel.

The article starts with an overview of the service container and service providers, describing what they are and providing some example code/configuration to clarify the concepts. It then gets into the creation of your own custom service provider. In their case they create a provider that doesn't really do anything but it does help to show how to make it, register it and put it to use in a controller.




SitePoint PHP Blog: How to Write JavaScript-Style Test Watchers in PHP

Thu, 20 Jul 2017 13:18:43 -0500

On the SitePoint PHP blog there's a new tutorial that talks about creating "watchers" in your PHP code similar to the ones that the Javascript world has used to detect changes in files and automatically perform actions.

In the land of JavaScript, it’s not uncommon to preprocess source code. In the land of JavaScript, developers write in syntax not widely supported, and the code is transformed into syntax that is widely supported, usually using a tool called Babel.

In order to reduce the burden of invoking the transformation scripts, boilerplate projects have started to include scripts to automatically watch for file changes; and thereafter invoke these scripts.

These projects I’ve worked on have used a similar approach to re-run unit tests. When I change the JavaScript files, these files are transformed and the unit tests are re-run. This way, I can immediately see if I’ve broken anything.

The author (Christopher Pitt) then shows how to create the project and make use of pre-processing and some sample scripts to run tests against. He shows how to set up the test configuration and provides an example test. Finally he includes a script that's used by the "watcher" to recompile the scripts before the tests are executed. To to the watching, he uses the yosymfony/resource-watcher package and a long running PHP script ("watch-test").




PHP.net: PHP 7.2.0 Beta 1 Released

Thu, 20 Jul 2017 12:49:13 -0500

In an announcement on the main PHP.net site, the PHP development team as officially announced the release of the first beta for PHP 7.2.0 - beta 1.

The PHP development team announces the immediate availability of PHP 7.2.0 Beta 1. This release is the first beta for 7.2.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

[...] PHP 7.2.0 Beta 1 builds on previous releases with: the much anticipated Sodium extension, Opcache improvements, Countable support for DOMNodeList and DOMNamedNodeMap improved handling for invalid UTF8 in json_decode() and many bugfixes...

You can find the complete list of updates in the NEWS entry for this beta and, as always, you can download this preview release from the QA downloads page or from windows.php.net/qa for the Windows binaries.




Laravel News: The Road To Laracon Soundtrack

Thu, 20 Jul 2017 09:46:12 -0500

On the Laravel News site they've posted an article sharing a series of podcasts dubbed the "Road to Laracon" where hosts Jacob Bennett and Michael Dyrynda talked with Laracon US 2017 speakers and asked them to suggest one song to use in the playlist.

Next week is Laracon US, and Jacob Bennett and Michael Dyrynda have been interviewing many of the speakers on the podcast. As part of the interview, they’ve asked the speakers to pick a few of their favorite songs and put it together in a Spotify playlist.

It features twenty-three songs and is an hour and forty-three minutes of listening pleasure and I enjoy trying to match the song to the speaker.

If you'd like to hear the interviews with some of the speakers, they've linked to a few at the end of the post including Freek Van der Herten, Jack McDade and Laura Elizabeth.







Matt Stauffer: What packages do you install on every Laravel application you create?

Wed, 19 Jul 2017 12:29:44 -0500

On his site Matt Stauffer has a post that asks the readers about the packages they always install for their Laravel applications (and not necessarily just Laravel related packages either).

In preparation for my upcoming [talk](http://customlaravel.com/) at [Laracon 2017](https://laracon.us/), which I'm titling "Custom Laravel," I [asked a quick question](https://twitter.com/stauffermatt/status/885666786036899840) on Twitter to my followers. [...] I wanted to know for my talk, but I was also just curious for my own purposes. Are there any packages I should check out that everyone else already knows about? Here's what I found, in order of the number of recommendations I received...

While most of the packages in his lists (unanimous support, well-loved, etc) are Laravel specific, mostly because of his audience on Twitter, there are some that weren't. These included:

You can check out his full listing in the remainder of the post and a link to another listing from Mike Erickson asking the same kind of question.




ThePHP.cc: Why Developers Should Not Code

Wed, 19 Jul 2017 11:16:01 -0500

On thePHP.cc blog Stefan Priebsch offers up an interesting opinion about code, developers and understanding - developers shouldn't code.

The ultimate problem with program code seems to be that no human really understands it. Sure, we can look at a short piece of code and be relatively clear on what it does, but can we still do the same thing with programs that span tens or even hundreds of thousands of lines?

[...] Well, sometimes I get a strong feeling that there is a shortage of good programmers, because I often find myself looking at legacy code, being unable to tell what it does, at least with reasonable certainty. [...] Personally, I already consider code to be problematic when there is a reasonable amount of doubt as to what it does (and why it exists). To me, uncertainty and discussions are a sure sign of bad code. Call me picky, but years of experience have taught me that this level of strictness makes sense.

He suggests that the fact a developer cannot recognize what current code is doing doesn't make you a poor developer, but the opposite. He talks some about the meaning of the word "code" and how it is written for a machine to understand, not a human. He ends the post talking about testing your code to provide an "executable specification" and, despite having this, a human-readable spec is still a requirement (like it or not).




BitExpert Blog: Mattermost Webhooks and PHP

Wed, 19 Jul 2017 10:49:26 -0500

On the BitExpert blog Stephan Hochdörfer shares his experience working with Mattermost webhooks and interfacing them with backend PHP scripts. Mattermost is an Open Source Slack clone.

In a recent attempt to automate a few things even more, I was looking for a way to post messages to our [Mattermost](http://mattermost.org/) instance via the [Incoming Webhook](https://docs.mattermost.com/developer/webhooks-incoming.html) feature of Mattermost. I did a quick search on [Packagist](https://packagist.org/search/?q=mattermost) for Mattermost client libraries and as it turns out there a quite a few. I picked the [thibaud-dauce/mattermost-php](https://packagist.org/packages/thibaud-dauce/mattermost-php) package simply because it was the first match.

He then walks through the installation of the package and how it works, using Guzzle, to send messages to the Mattermost service. The incoming request is just a JSON-formatted data set, so it's easily parsed in plain PHP. The output, however, needs to be in a format Mattermost understands. That's where the package comes in, providing a "send" method that allows for the customized text and optional attachment to be sent to the Mattermost server.




Scotch.io: Achieving Geo-search with Laravel Scout and Algolia

Wed, 19 Jul 2017 09:38:24 -0500

The Scotch.io site has posted a tutorial from author Julien Bourdeau showing you how to combine Laravel Scout, a tool that enables full-text searching on Eloquent models and the Algolia searching service to create a geo-search to locate items in your data based on physical location.

Laravel Scout makes it very easy to setup an external search engine to create consumer-grade search quickly. The package comes with Algolia as a default search engine. I'd like to demonstrate how to make use of the geo-location search feature with Scout.

In this tutorial, you'll learn how to prepare your data for Algolia and Laravel Scout to retrieve items based on location.

We recommend you use front-end search for your app because this implementation model is most efficient. That being said, there are cases where you need backend search, for instance, if you want to generate reports.

The tutorial is then broken up into several steps towards the goal of creating the application:

  • Install Scout
  • Format your data for indexing
  • Search for your records
  • Leveraging Macros

The searching they create allows for location of data either by searching in a given location (coordinates and radius) or locating items inside of a "zone" (a rectangle defined by at least two points). All code is included as well as examples of the data structure Algolia requires for your data input.




Community News: Recent posts from PHP Quickfix (07.19.2017)

Wed, 19 Jul 2017 08:05:01 -0500

Recent posts from the PHP Quickfix site: