PHPNews

Too much M4g1c will kill you (or at least bite your ass)

Written by SOFTonSOFA - Published on SOFTonSOFA
Aggregated on Thursday July 13, 2017 - Permalink

So, as you know, I’m a big fan of Laravel, in particular Eloquent is my favourite. The beauty and value of both is a lot of conventions and magic happening behind the scenes. That magic, when balanced, allows us focus on things that really matter, rather than taking care of boilerplate and tedious, repetitive tasks, […]

Continue reading »


Tinker like a boss – WTF?!

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

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 »


Tinker like a boss – helpers

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

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 »


Laravel Searchable – the best package for eloquent

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

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 presentation it is enough – simple m-m relation between Users with friends […]

Continue reading »


Revisionable – a quick example

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

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/] [crayon-58f11d8a26806207948363/] That’s it! Any issues, please post to …

Continue reading »


array_merge vs array_replace vs + (plus aka union) in PHP

Written by SOFTonSOFA - Published on SOFTonSOFA
Aggregated on Friday November 13, 2015 - Permalink

If you wrote some PHP, most likely you have used array_merge here and there for your arrays. You may have met array_replace function, introduced in PHP5.3. Finally, you could notice + operator (aka union). Since all 3 do similar thing, and the docs don’t quite describe the difference between them, here’s a nice image of […]

Continue reading »