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

North Meets South Podcast:
Episode #28 - Eloquent observers, managing client expectations, and Larav
May 23, 2017 @ 11:32:26

In the most recent episode of the North Meets South podcast - Episode #28 - hosts Jacob Bennett and Michael Dyrynda talk about Laravel. More specifically they cover Eloquent functionality, client expectations, and packages.

In this episode, Jake and Michael talk about Eloquent observers and answer listener questions about managing client expectations and packages we use in our Laravel applications.

Other topics mentioned in this episode include Dash (the documentation tool), the "Supercharge Your Tinker Workflow" article and the Sentry package for Laravel. You can listen to this latest show either using the in-page audio player or by downloading the mp3 directly for listening offline. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter to get the latest updates when new shows are released.

tagged: northmeetssouth podcast ep28 eloquent observer client expectations laravel package

Link: http://www.northmeetssouth.audio/28

php[architect]:
Artisanal: Project Creation
May 18, 2017 @ 11:59:12

On the php[architect] site they've shared an article originally from the May 2016 issue of the magazine by Joe Ferguson: Artisanal: Project Creation (also released as a free PDF).

Every developer has a set way of starting a new project. Most frameworks have a linear path to getting started, and Laravel is no exception. With a few commands, you can quickly get started configuring routes, writing controllers, and saving data in a database.

In the article Joe walks you through the tools and commands that come with the Laravel framework to make getting up and running quickly easier. He covers tools available for both the backend and frontend functionality as well as testing (mentioning Dusk), routing, middleware groups and database functionality.

tagged: phparchitect magazine free article project creation laravel artisan

Link: https://www.phparch.com/2017/05/artisanal-project-creation/

DotDev.co:
Using Laravel Mix for Your WordPress Theme
May 12, 2017 @ 10:16:05

On the DotDev.co blog there's a recent tutorial posted from Eric Barnes showing you how to combine Laravel Mix and WordPress to make it easier to manage webpack dependencies.

Laravel Mix is a fluent wrapper around the webpack module bundler, and it provides common tools that help you compile CSS and JavaScript. It’s easy to work with, and although it comes baked into the Laravel framework, you can use it anywhere.

This site is using WordPress, and when I created the theme I used Mix to handle the asset compiling; it was simple to setup. Here is a quick overview of how I did it in four steps. Please note, you will need to have a recent version of Node and npm installed on your machine before continuing.

He then walks you through a four step process to set up the integration between the two:

  • Step 1. Create the package.json File
  • Step 2. Webpack Mix
  • Step 3. Create Your style.scss File
  • Step 4. Create an app.js

He ends the post with some helpful commands you can use while you're in the development process including compiling for both dev and production environments. More information about Mix can be found in the Laravel documentation.

tagged: laravel mix wordpress tutorial npm node css javascript install build

Link: https://dotdev.co/laravel-mix-wordpress/

Tighten.co:
Supercharge Your Laravel Tinker Workflow
May 11, 2017 @ 09:37:19

On the Tighten.co blog they have a new post that aims to help you get the most out of the Laravel command line tool's (artisan) tinker command.

Laravel's command line tool is called "Artisan," and it comes with a few powerful features out of the box. Tinker, accessed via php artisan tinker, is arguably my favorite Artisan command. It speeds up my workflow and allows me to interact with my application in ways I would have never thought possible.

Tinker is a REPL (read-eval-print loop). A REPL gives you a prompt that allows you to interact with your application using your language's native syntax (in this case, PHP) in a command-line style.

The post then walks through some of the "hidden features" this command line tool offers including:

  • basic usage to call Laravel code (like getting all posts using Post::all)
  • a more interactive version of dd(), a debugging tool
  • improving speed on a Laravel Dusk testing workflow
  • direct access to the PHP docs

The post ends with a few other smaller things this helpful tool can do like showing a stack trace, listing the command history and re-throwing the last exception.

tagged: laravel workflow tinker commandline tool artisan tutorial

Link: https://blog.tighten.co/supercharge-your-laravel-tinker-workflow

Matt Stauffer:
What happens to Laravel if Taylor Otwell disappears?
May 09, 2017 @ 11:52:25

In this post to his site Matt Stauffer poses an interesting question around one of the more popular PHP frameworks these days. He wonders "what would happen to Laravel if Taylor Otwell disappears?"

After we talked a bit about enterprise apps on the Laravel Podcast the other day , a few folks in the Laravel community have been talking about what makes a tool enterprise-ready. I have a lot of thoughts about support plans, SLAs, and other such features of "enterprise-readiness", but I'll save those for a later date. Today, let's talk about the easiest-to-dismiss concern: What happens if Taylor disappears suddenly?

This question brings up the point that, unlike a framework backed by a company, a framework backed by an individual relies on that individual's desire and ability to keep the project running. What happens if Taylor decides he wants to retire and be a goat farmer?

He shares the plan that's already been set in place with Jeffrey Way (of Laracasts) being the next in line to head up the project. He also mentions the Laravel, LLC company that wouldn't go away if Taylor did and how the community would fit in.

tagged: laravel taylorotwell project leader jeffreyway company community

Link: https://mattstauffer.co/blog/what-happens-to-laravel-if-taylor-otwell-disappears

Hackernoon.com:
Laravel in Docker
May 05, 2017 @ 12:13:32

On the Hackernoon.com site they've posted a tutorial showing you how to set up a Docker image of a Laravel application to help speed up your development using the framework and standardize the environment it lives in.

With this article you’ll learn how to prepare a Docker image of a Laravel application, push it to the registry, and use Docker in Continuous Delivery.

The post starts with a brief introduction of the two technologies at play, the Laravel framework and Docker, and what they provide. The tutorial then walks you through the entire process of setup, configuration and deployment of the Docker image:

  • Install Docker
  • Write a Dockerfile (including the install of Laravel)
  • Build Docker image (and Run)

At this point you have the image set up and ready to serve Laravel requests so they move on to sharing the image out on a Docker registry. In this case they opt to deploy it to hub.docker.com and use the login and push commands to quickly and easily share your creation. Finally they provide some use cases for this kind of deployment including creating standard development environments, using them for testing and keeping a consistent environment between development, staging and production.

tagged: laravel framework docker tutorial configure deploy dockerhub environment

Link: https://hackernoon.com/laravel-in-docker-ceed4465352

Laravel News:
Laravel 5.5 Gets Improvements with the Default Error Views
May 05, 2017 @ 10:55:31

On the Laravel News site there's a recent post showing a feature coming in version 5.5 of the framework that will help make creating error views easier:

Coming in Laravel 5.5 is a new and improved design for the error pages. The default errors will extend from an errors::layout file and get some small design additions over the current style with flexbox and a vertically centered message.

They compare the older version to the newer, cleaner one and how you can still, even in 5.5, have your own custom error pages named based on the HTTP error code (like 500.blade.php or 403.blade.php). They end the post covering the renderHttpException and how it determines which of the error templates to use.

tagged: laravel error template v55 update customize blade tutorial

Link: https://laravel-news.com/laravel-5-5-error-views

QCode.in:
Easy roles and permissions in Laravel 5.4
May 03, 2017 @ 12:06:41

On the QCode.in site Saqueib Ansari has written up a tutorial showing how to use a package in Laravel applications to manage roles and permissions easily. This package, spatie/laravel-permission, compliments the current Laravel roles/permissions handling with a few handy features that make management and evaluation simpler.

Although laravel comes with Policies to handle the authorization but I wanted to have an option to just create permissions in the database which we can manage by a UI in the admin panel, pretty standard. we can implement our own role and permission from scratch but I am going to use [spatie/laravel-permission](https://github.com/spatie/laravel-permission) package for this. This package was inspired by Jeffrey ways screencast and it’s very well maintained and very easy to use. It has everything we need and plays very well with Laravel Gate and Policies implementations.

He walks through the creation of a new Laravel application, running the auth:make to generate the authentication functionality and adding the spatie/laravel-permission package to the service provider. He creates several models for permissions and roles and updates the User model with a new trait. Once the migrations are run, he creates a default permission set. Then it's on to the code for the endpoints to work with roles (including syncing them with permissions). He then moves over to the views, showing how to use the can helper to determine if a user has access, creating an Authorizable trait and an AuthorizationException handler. Finally the tutorial wraps up with the roles and permissions management functionality complete with code and screenshots of the result.

tagged: laravel roles permissions tutorial package laravelpermission spatie management

Link: http://www.qcode.in/easy-roles-and-permissions-in-laravel-5-4

Medium.com:
Using Guzzle 6 Middleware in a Laravel Application
May 03, 2017 @ 11:10:36

In this recent post on Medium.com author Paul Redmond shows how to use Guzzle 6 middleware in a Laravel application instead of the framework's own functionality.

The most significant change between Guzzle 5 and 6 is moving away from the event system I grew so accustomed to in Version 5 to middleware in version 6. Needless to say, it was a big adjustment for me at first and it felt like a downgrade. After my initial grumbling, the upgrade guide explains the reasoning for the change.

[...] I prefer to keep my dependencies as up-to-date as possible so I decided to learn Guzzle 6 and become more familiar with the middleware. The concepts are pretty straightforward and I have a few patterns that I like to use when building out middleware within my Laravel applications.

He then shares some code he's used to generate an authorization header and how to add it into the Laravel application as a service using the "tagged" middleware functionality. Finally he shows it in use making a simple request to the endpoint and showing the response results, including the authorization header.

tagged: guzzle middleware laravel application tutorial tagged integration

Link: https://medium.com/@paulredmond/using-guzzle-6-middleware-in-a-laravel-application-7fbd6d966235

Laravel Daily:
Can Laravel Be Used for Big Enterprise Apps?
May 02, 2017 @ 10:12:42

On the Laravel Daily site there's a post that looks to answer a question often posed about any framework but, in this case, about Laravel - can Laravel be used for big enterprise apps?

Yesterday I’ve listened to a new Laravel Podcast episode with Taylor Otwell, Jeffrey Way and Matt Stauffer – and they (finally) talked about creating big apps with Laravel, lately this question is asked a lot by everyone. So is Laravel “fit” or “mature enough” for big projects? Since the podcast guys don’t provide a transcript, and listening to 50 minutes can be an overkill, I decided to write a summary, quoting the conversation and dividing the answers into more readable format like Q&A and bullet points, also relevant links. So, let’s dive in!

The post is then divided up into a few of the topics involved in Laravel being used for larger applications:

  • What is a big app?
  • So can Laravel be used for big apps?
  • People are irrational
  • Enterprise world
  • Any examples of big Laravel apps?
  • It’s not about the framework
  • Ok, so how to build big apps?

For each point there's a comment from the episode with their own response (sometimes more than one, just depending on the subject).

tagged: laravel enterprise application podcast topics transcript

Link: http://laraveldaily.com/can-laravel-used-big-enterprise-apps-summary-laravel-podcast/