Category Archives: PHP

Tinymce config for Laravel File Manager

 

Middleware for localization

Creating a middleware file

Add middleware to app/Http/Kernel.php

Apply middleware in route.php

Middleware

Note

  1. Constructor of a controller will be execute before route, middleware and session.

Reference

  1. https://laravel.com/docs/5.4/middleware

Model Trait for Laravel

Trait

Usage

 

Socket in PHP

Server:

Client:

Commands:

php server.php
php client.php

Reference:

  1. https://www.php.net/manual/en/function.socket-read.php
  2. https://xyz.cinc.biz/2016/12/php-socket-client.html
  3. socket_create() not found
    https://blog.johnsonlu.org/freebsdinstall-php-sockets-so/

Image Library – intervention/image

Official Site:

http://image.intervention.io/getting_started/installation

Resize and Crop Example:

 

Guzzle usages

Basic

Get raw response

Reference: