PHPNews

Tinker like a boss – WTF?!

This is part of the series tinker like a boss (in psysh) tinker… what? includes casters (presenters) aliases http (and other) helpers wtf is this error? Errors – WTF? Usually getting verbose errors in tinker is now what you want. You made a typo, called wrong method etc – all feedback you need then is […]

Continue reading »

Written by SOFTonSOFA - - Aggregated on Sunday July 9, 2017


Tinker like a boss – helpers

This is part of the series tinker like a boss (in psysh) tinker… what? includes casters (presenters) aliases http (and other) helpers wtf is this error? Helpers You may find yourself in need of some handy shortcuts when tinkering. I often need to make an HTTP call or run a quick test request, that works […]

Continue reading »

Written by SOFTonSOFA - - Aggregated on Sunday July 9, 2017


Tinker like a boss – aliases

This is part of the series tinker like a boss (in psysh) tinker… what? includes casters (presenters) aliases http (and other) helpers wtf is this error? Aliases Class aliasing is very simple concept, that allows you to call a class by its alas, rather than original name. It’s not very common to use aliases when […]

Continue reading »

Written by SOFTonSOFA - - Aggregated on Monday September 26, 2016


Tinker like a boss – custom casters

This is part of the series tinker like a boss (in psysh) tinker… what? includes casters (presenters) aliases http (and other) helpers wtf is this error? Custom casters Using Laravel, you’re already familiar with idea of casters even if you’re not aware of that. Check this out: [crayon-5a0710bfe5ce4756035332/] You can …

Continue reading »

Written by SOFTonSOFA - - Aggregated on Monday September 26, 2016


Tinker like a boss – custom includes

This is part of the series tinker like a boss (in psysh) tinker… what? includes casters (presenters) aliases http (and other) helpers wtf is this error? Custom includes Let’s stick to a convention of a .tinker file bootstrapping our REPL env. PsySH allows including such file in 2 ways: inline, provided at runtime: …

Continue reading »

Written by SOFTonSOFA - - Aggregated on Monday September 26, 2016


Tinker like a boss (in psysh)

tinker… what? includes casters (presenters) aliases http (and other) helpers wtf is this error? Tinker… what? REPL idea is nothing new, but it wasn’t very popular in day-to-day work in PHP until recently, when Laravel 4 came out and shipped with BORIS. It allowed interacting with whole Laravel app directly in the …

Continue reading »

Written by SOFTonSOFA - - Aggregated on Monday September 26, 2016


PHP how to use $this in Closure – context matters

Anonymous functions, in php known as Closures, come in handy very often. One application in particular is very useful – extending classes, thanks to the capability to bind the closure to an instance and class scope. However, binding to instance may prove a bit tricky, so let’s go through it together. Let’s start with …

Continue reading »

Written by SOFTonSOFA - - Aggregated on Saturday November 21, 2015


Revisionable – a quick example

A short reminder about my revisionable package (compatible with L4 & L5+) and quick example of how you can use it: 1. Controller: [crayon-58f11d8a267d7595024777/] 2. Model: [crayon-58f11d8a267e7729790973/] 3. Presenter: [crayon-58f11d8a267f1482558231/] 4. Views (only relevant parts) [crayon-58f11d8a267fd933646037/…

Continue reading »

Written by SOFTonSOFA - - Aggregated on Saturday October 10, 2015


Laravel Searchable – the best package for eloquent

In this first post of a series about https://github.com/jarektkaczyk/eloquence – the package that allows working with eloquent models in even simpler manner – I’m going to introduce you to the searchable feature of the builder class. Imagine app with simple friendship system: [crayon-58f11d8a26f6f915408817/] For the …

Continue reading »

Written by SOFTonSOFA - - Aggregated on Wednesday May 13, 2015