Installing Nginx, PHP, MySQL (LEMP) Stack on Ubuntu 18.04 – Part -1 (Extended)

Configure nginx Virtual Hosting and the PHP ProcessorPermalink In this guide, the domain example.com is used as an example site. Substitute your own FQDN or IP in the configuration steps that follow. Nginx uses server directives to specify name-based virtual hosts. Nginx calls these server…

Laravel Pivot table working with Eloquent ORM

Here is the pivot table. Will make relation with laravel eloquent. shops – id – name products – id – name product_shop – product_id – shop_id product_shop is called a “pivot” table. Lets make a relation between shops table and…

PHP Multiple Try Catch

PHP handle multiple exception at the same time. Use multiple try catch at the same line not nested try catch. try { // run your code here } catch (Exception $e) { echo $e->getMessage(); } catch (InvalidArgumentException $e) { echo…