Categories
PHP Development Web Development

PHP Singleton Pattern

Singleton pattern is used where you need to handle some kind of expensive task – like connection to a database – and you want to be sure that only one instance of an object exists at a time. A very good example of such patter is below: // Example of Singleton Class. class DBConnection { […]

Categories
WordPress Development

Deprecated: contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead. in …/wp-includes/functions.php on line 5152

There can be several plugins related to the issue, but it can be also SendGrid plugin. The fix this problem modify sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php in line 52 – replace: add_filter( ‘contextual_help’, array( __CLASS__, ‘show_contextual_help’ ), 10, 3 ); with: add_filter( ‘current_screen’, array( __CLASS__, ‘show_contextual_help’ ), 10 ); And replace public function in line 101 public static function […]

Categories
Laravel Development Web Development WordPress for Beginners

Laravel vs WordPress

What to use – Laravel or WordPress for a CMS project? Well,  it depends on specification and budget. For really low budget WordPress is by far much much better option. You can save huge money on design/layout, and you can find really good and not expensive web hosting for WordPress projects starting from about £30 […]

Categories
Laravel Development

Laravel Jetstream – Jet Another Headache

Surprisingly for the out of the box authentication scaffolding Laravel 8 uses Jetstream/Tailwind CSS framework. What does Tailwind CSS do? Well, it does more or less the same what Bootstrap does, except that for Bootstrap you have tons of tutorials, free code, and cheap templates. Tailwind CSS, if you prefer this route, is not ugly […]

Categories
Laravel Development

The best web hosting for Laravel 8

Where to host Laravel (Laravel 8) installation? Obviously, you can install Laravel locally, on your laptop, but we will not analyse such scenario here. Your local Laravel website will not be visible to the outside world, unless you go with dynamic DNS messy route. There are many web hosting companies offering Laravel installations, they promise […]

Categories
Laravel Quick Fix

Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails

The full messy error message can look like this: PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails This can happen when, let’s say, you have related columns Posts and Comments and you want to delete post, assuming that related comments will be swept away […]

Categories
PHP Development

PHP SOLID principles – mess explained a little bit

In object oriented programming there are some rules which help to keep development less messy and maintenance of developed systems easier and cheaper. One of such set or rules are SOLID principles: S – Single Responsibility Principle O – Open-Closed Principle L – Liskov Substitution Principle I – Interface Segregation Principle D – Dependency Inversion […]

Categories
Web Development WordPress for Beginners

WordPress taxonomy explained

WordPress taxonomy is one of the main reasons for which WordPress is so popular CMS framework not only for blogs but for e-commerce too. WordPress taxonomy extends incredible flexibility of this framework and plays significant role in  SEO peformance. Taxonomy as such means classification of things, so, sorting out an online shop’s products in different […]

Categories
Laravel Development

Laravel Mailable – how to add subject to email

Sending email in Laravel is simple, and is based on few steps, assuming that some mail provider (like SendGrid for instance) is already set in .env file. install Maillable module for some specific type of email you would like to send: php artisan make:mail NotificationEmail -m emails.notificationEmail the above produces mailable class:  App/Mail/NotificationEmail.php and mail template […]

Categories
Django and Python Laravel Development Web Development

Django vs Laravel 8

As for most such comparisons much depends on what you need the frameworks for. Essentially they both are MVC, keeping in mind that MTV (Model Template View) for Django means in fact Model View Controller. That is – in Django View you keep controller logic, and Template is basically where you design how your interface […]