Posts

Virtual host setup in XAMPP for Laravel Project

1. C:\xampp\apache\conf\https.conf # Virtual hosts Include conf/extra/httpd-vhosts.conf 2. C:\Windows\System32\drivers\etc\hosts 127.0.0.1       localhost 127.0.0.1       helpdesk.local 127.0.0.1       teledaktar.local 3. C:\xampp\apache\conf\extra\httpd-vhosts.conf <VirtualHost *:80>     DocumentRoot "C:/xampp/htdocs/helpdesk/public"     ServerName helpdesk.local </VirtualHost> <VirtualHost *:80>     DocumentRoot "C:/xampp/htdocs/teledaktar/public"     ServerName teledaktar.local </VirtualHost> Now,  URL 1 :   http://helpdesk.local URL 2 :   http://teledaktar.local

API - Few types of API

Web Service APIs SOAP (Simple Object Access Protocol) XML-RPC (Extensible Markup Language - Remote Procedure Call) JSON-RPC (JavaScript Object Notation -  Remote Procedure Call ) REST (REpresentational State Transfer) OS Functional APIs Access to file system Access to User Interface Hardware APIs Video Acceleration Hard disk drivers PCI Busses (Peripheral Component Interconnect Busses)

Password set for root user in MySQL

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');

Laravel Event Listener for keeping history

App\Providers\EventServiceProvider.php protected $listen = [     'App\Events\ResolveHistoryEvent'=>[         'App\Listeners\ResolveHistoryEventListener'     ] ]; php artisan event:generate App\Modules\Tickets\Controllers\TicketsController.php public function reopenTicket($ticketId){     $ticket = Tickets::find($ticketId);     $ticket->resolve_status = 2;     $ticket->reopen_time = Carbon::now();     $ticket->save();     event(new ResolveHistoryEvent($ticket));     return redirect('tickets/active-list')->with('flash_success','Ticket reopen successfully!'); } App\Events\ResolveHistoryEvent.php public $resolveHistory; public function __construct($ticket) {     $this->resolveHistory = $ticket; } App\Listeners\ResolveHistoryEventListener.php public function recordTicketResolveHistory($ticket){     $resolveHi...

WP register_post_type() with custom CMB2 meta box

functions.php register_post_type('portfolio',[ 'labels'=>[ 'name'=> 'Portfolio', 'add_new_item'=>'Add new portfolio', 'view_item'=>'View portfolio', ], 'public'=>true, 'menu_icon'=>'dashicons-edit', 'menu_position'=>1, 'supports'=> ['title','editor','thumbnail'] ]); custom.php add_action('cmb2_admin_init','custom_metaboxes'); function custom_metaboxes(){ $portfolioMetaBox = new_cmb2_box([ 'object_types'=>['portfolio'], 'id'=>'portfolio-additional-fields', 'title'=>'Portfolio Additional Fields' ]); $portfolioMetaBox->add_field([ 'id'=>'portfolio_designation', 'name'=>'Portfoilo Designation', 'type'=>'text' ]); $portfolioMetaBox->add_field([ ...

add_filter() function in WP

function filtering($a){ echo "<h5> $a </h5>"; } add_filter('the_title','filtering'); add_filter() function has two parameters 1st : The function/hook which will be filtered 2nd : Filtering will done by which function

WP Hook Creation

functions.php {Back end} //A function named basicHook which have two parameters $a and $b. function basicHook($a,$b){ echo "First Value : $a <br/>"; echo "Second Value : $b <br/>"; } //Creating the hook : 1st parameter : hook name 2nd parameter : executing function 3rd parameter : executing priority 4th parameter : maximum number of parameters acceptance in the hook add_action('ahook','basicHook',1,2); header.php {Front end} //Calling the hook from front end by the function named do_action(); 1st parameter : defined hook name 2nd and 3rd parameter hook value. do_action('ahook',500,600);