Sevalla is the all-in-one PaaS for your web projects. Host and deploy your applications, databases, object storage, and static sites. Enjoy advanced deployment pipelines, a complete database studio, instant preview apps, and one-click templates. The pricing is simple: no hidden fees, no seat-based pricing, and you pay only for what you use. Get real human support from developers.

Get started now with a $50 credit at Sevalla.com.

Hunting for great names in programming

Link –

A great story by DHH on his quest to find good names for some functions he was working on.

One of the real delights of programming is picking great variable, method, and class names. But an even greater treat is when you can name pairs, or even whole narratives, that fit just right. And the very best of those is when you’re forced to trade off multiple forces pulling in different directions.

https://m.signalvnoise.com/hunting-for-great-names-in-programming-16f624c8fc03

Read more

Laracon EU recap day 2

Link –

Here's Simon Nicklin's recap of day two of the excellent Laracon EU conference: https://www.linkedin.com/pulse/laracon-eu-2016-conference-day-2-simon-nicklin

Personally I had a great time at Laracon. I couldn't relax that good until after I delivered my own talk. Luckily it went well and I got some good feedback. It was very good to see both new and familiar faces. Most talks were excellent, and the venue was amazing. Just look at this picture:

Laracon

I'll be sure to attend next year's Laracon!

Read more

Stay up to date with all things Laravel, PHP, and JavaScript.

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

Debugging collection chains

Original – by Freek Van der Herten – 2 minute read

A couple of weeks ago I published a blog post on how you can easily debug collections using a dd macro. Meanwhile my company released a package that contains that macro. In this post I'd like to introduce a new dump macro, recently introduced in the package, that makes debugging collection chain…

Read more

Laravel LTS is a Trap

Link –

A couple of months ago Jason McCreary, creator of Laravel Shift, wrote down his opinion on the Laravel's LTS release. I couldn't agree more with this piece.

The more developers that get trapped by LTS, the more of a drag it creates on the Laravel community. Potentially having adverse affects on its growth. Using LTS as a minimum compatibility line for a Laravel package or other third-party code is understandable. But freezing your apps to an LTS version is not. Your apps should run the latest stable version of Laravel.

https://medium.com/@jasonmccreary/laravel-lts-is-a-trap-97b1d1103961

Read more

Learn about grant types in Laravel Passport

Link –

Laravel Passport is an easy to use OAuth2 server that was released alongside Laravel 5.3. Mohamed Said wrote an excellent guest post at Laravel News about the grant types used in Passport.

OAuth2 is a security framework that controls access to protected areas of an application, and it’s mainly used to control how different clients consume an API ensuring they have the proper permissions to access the requested resources.

Laravel Passport is a full OAuth2 server implementation; it was built to make it easy to apply authentication over an API for laravel-based web applications.

https://laravel-news.com/2016/08/passport-grant-types/

Read more

Laracon EU recap day 1

Link –

The Laracon EU conference is happening right now. Talking to other developers is a joy like always, the speakers are great and the venue is amazing. Here's a good recap written by Simon Nicklin of the first day of the Laracon EU conference.

We entered the building and joined the back of the queue. I say we, even though I travelled on my own I already felt part of something. The queue snaked around a mood light corner to the awaiting registration desk where we are split into last name lanes. A pleasant volunteer welcomed me as I showed her my ticket. After a quick flick through the name cards I'm registered. For me this was the start of Laracon EU 2016.

https://www.linkedin.com/pulse/laracon-eu-conference-2016-day-1-simon-nicklin

Read more

A package to easily work with regex in PHP

Original – by Freek Van der Herten – 2 minute read

PHP offers some functions to work with regular expressions, most notably preg_match, preg_match_all and preg_replace. Unfortunately those functions are a bit hard to use. Take preg_match_all for example, it requires you to pass in an array by reference to get all the matches. When something goes…

Read more

How to use WordPress as a backend for a Laravel Application

Link –

Recently Eric L. Barnes put a new coat of paint on Laravel News. Behind the scenes there were some changes as well. In a new post he explains how he integrated the Wordpress backend with a Laravel app.

Last week I relaunched Laravel News, and the new site is running on Laravel with WordPress as the backend. I’ve been using WordPress for the past two years, and I’ve grown to enjoy the features that it provides. The publishing experience, the media manager, the mobile app, and Jetpack for tracking stats.

I wasn’t ready to give these features up, and I didn’t have the time to build my own system, so I decided to keep WordPress and just use an API plugin to pull all the content I needed out, then store it in my Laravel application. In this tutorial, I wanted to outline how I set it all up.

https://laravel-news.com/2016/08/wordpress-api-with-laravel/

Read more

Improving readability using array_filter

Link –

In this post I'd like to share a quick tip on how you can improve the readability of your code with array_filter.

Today I was working on some code that looked something like this:

class Address
{
    ...

    public function toArray()
    {
        $address = [
            'name' => $this->name,
            'street' => $this->street,
            'location' => $this->location,
        ];

        if ($this->line2 != '') {
            $address['line2'] = $this->line2;
        }

        if ($this->busNumber != '') {
            $address['busNumber'] = $this->busNumber;
        }

        if ($this->country != '') {
            $address['country'] = $this->country;
        }


        return $address;
    }
}

Did you know that you can use array_filter to clean this up? I didn't, until today.

When that function is called without a second argument it will remove any element that contains a falsy value (so null, or an empty string) Here's the refactored, equivalent code:

class Address
{
    ...

    public function toArray()
    {
        return array_filter([
            'name' => $this->name,
            'street' => $this->street,
            'line2' => $this->line2,
            'busNumber' => $this->busNumber,
            'location' => $this->location,
            'country' => $this->country,
        ]);
    }
}

That's much better!

Just be careful when using this with numeric data that you want to keep in the array. 0 is considered as a falsy value too, so it'll be removed as well.

Read more

Joind.In Needs Help

Link –

Joind.in is a website where attendees can leave feedback for speakers delivering talks and conferences and user groups. This feedback is very useful for the speakers who which improve their skills. In my mind it is an essential part of the PHP ecosystem.

For the last 6 years Lorna Jane Mitchell and Rob Allen have maintained the project. They are now looking for others to take over their duties.

This post is about the open source project, Joind.in. Joind.in is a tool to allow attendees at conferences or other events to offer immediate public feedback to speakers and organisers at those events. Joind.in is an open source project run by volunteers. For the last 6 years I've been a maintainer of this project, following a year or two of being a contributor. Over the last few months, myself and my comaintainer Rob Allen have been mostly inactive due to other commitments, and we have agreed it's time to step aside and let others take up the baton.

http://lornajane.net/posts/2016/joind-in-needs-help

Read more

I Peeked Into My Node_Modules Directory And You Won’t Believe What Happened Next

Link –

Jordan Scales examined the contents of the node_modules directory a discovered a lot of junk.

While code bloat continues to slow down our websites, drain our batteries, and make “npm install” slow for a few seconds, many developers like myself have decided to carefully audit the dependencies we bring into our projects. It’s time we as a community stand up and say enough is enough, this community belongs to all of us, and not just a handful of JavaScript developers with great hair.

I decided to document my experiences in auditing my projects’ dependencies, and I hope you find the following information useful.

https://medium.com/friendship-dot-js/i-peeked-into-my-node-modules-directory-and-you-wont-believe-what-happened-next-b89f63d21558

Read more

Build a Facebook chatbot in 10 minutes with PHP

Link –

In a new post on his site, Christoph Rumpel explains how you can quickly build a Facebook chatbot with PHP.

The chatbot topic is huge right now. Finally there is something quite new again and nobody knows what's happening next. This is the perfect time to start experimenting with chatbots and to build your own one right now. Give me 10 minutes of your time and I will give you your first chatbot!

http://christoph-rumpel.com/2016/08/build-a-php-chatbot-in-10-minutes/

Read more

moment().endOf(‘term’)

Link –

Without any doubt Tim Wood, the creator of the awesome moment.js library, has done a lot for the community. It's really a shame that the constant pressure of maintaining the library has taken it's toll.

The correlation between Open Source and burnout is no secret, and I am not immune to it. ... Seeing bugs and issues continue to roll in and being mentally unable to address them has led to feelings of failure and depression. When looking at the moment project, I could only see the negatives. The bugs and misnomers and mistakes I had made. It let to a cycle of being too depressed to contribute, which led to being depressed because I wasn’t contributing.

https://medium.com/@timrwood/moment-endof-term-522d8965689

Read more

Practicing YAGNI

Link –

In a new post on his blog Jason McCreary, creator of Laravel Shift, wrote down the summary of his Laracon US talk.

I consider myself a searcher. On a quest to find the Holy Grail of programming practices - that single practice which instantly levels up my skills. While I know this doesn’t exist, I do believe in a set of practices. Recently, I found one to be YAGNI.

YAGNI is a principle of eXtreme Programming - something I practice daily at work. YAGNI is an acronym for You Aren’t Gonna Need It. It states a programmer should not add functionality until deemed necessary. In theory, this seems straightforward, but few programmers practice it.

http://jason.pureconcepts.net/2016/08/practicing-yagni/

Read more

Some handy collection macros

Original – by Freek Van der Herten – 4 minute read

Laravel's collection class is truly wonderful. It contains a lot of handy methods and you can create some very elegant code with it. In client projects I found myself adding the same macro's over and over again. That's why my colleague Seb and I took some time to create a package aptly called…

Read more

Things I learned from reading Laravel: Up and running

Original – by Freek Van der Herten – 3 minute read

Matt Stauffer is currently putting the final touches on his new book called Laravel: Up And Running. It aims to be a good guide for newcomers to the framework. But even if you've got some experience with Laravel, it should be worth your time to read it. Even Matt himself picked up a lot of cool…

Read more

The next version of Laravel News has been launched

Link –

Earlier today laravel-news.com, the official Laravel news source, received a new coat of paint. In a post announcing the launch Eric shares how the site works behind the curtains.

During this move, I have redone the way the site is powered. Previously it ran on WordPress with a custom theme I put together, it worked fine but added new features, and sections became harder and harder, and I wanted the ability to use what I am comfortable with, Laravel. However, I didn’t want to give up the media library and editing experience of WordPress.

So to have the best of both worlds I kept the old site on WordPress and used the WP Rest API paired with the Laravel Scheduler. This allows me to automatically sync data from WordPress into my database without having to rebuild an entire CMS admin area. I have the same setup for the podcast section, and it hooks into the Simplecast API to pull those over.

https://laravel-news.com/2016/08/welcome-to-the-next-version-of-laravel-news/

I sure would like to read a tutorial on how that sync works in detail.

Read more