PHP code example of codedungeon / php-messenger

1. Go to this page and download the library: Download codedungeon/php-messenger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codedungeon / php-messenger example snippets


	   'providers' => [
            ...
			Codedungeon\PHPMessenger\MessengerServiceProvider::class,
			...
	

	    'aliases' => [
    	...
            'Messenger' => Codedungeon\PHPMessenger\MessengerServiceProvider::class,
		...
	

		'providers' => [
			...
			Codedungeon\PHPMessenger\ServiceProvider::class,
			...
		],
	

		// add use statement
		use Codedungeon\PHPMessenger\Facades\Messenger;

		// handle method
		public function handle()
		{
			echo PHP_EOL;
			$msg = "PHP Messenger v" . Messenger::version();
			Messenger::important($msg);
			Messenger::info("-- Using Laravel Package (Facades)");
		   ...
		}
	



odedungeon\PHPMessenger\Messenger;

$messenger = new Messenger();

$messenger->success("Success Message w/ Label"," SUCCESS ");
$messenger->info("Information Message");
...


Messenger::log(msg:string, [label:string - optional])

Messenger::info(msg:string, [label:string - optional])

Messenger::debug(msg:string, [label:string - optional])

Messenger::critical(msg:string, [label:string - optional])

Messenger::error(msg:string, [label:string - optional])

Messenger::success(msg:string, [label:string - optional])

Messenger::warning(msg:string, [label:string - optional])

Messenger::warn(msg:string, [label:string - optional])

Messenger::important(msg:string, [label:string - optional])

Messenger::status(msg:string, [label:string - optional])

Messenger::notice(msg:string, [label:string - optional])

Messenger::note(msg:string, [label:string - optional])

Messenger::version() -> returns current package version

bash
composer