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 […]