<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jcergolj / in-app-notifications-for-laravel example snippets
namespace App\Http\Controllers;
use Jcergolj\InAppNotifications\Facades\InAppNotification;
class UserController extends Controller
{
public function store(Request $request)
{
InAppNotification::success('User was successfully created.');
return view('mailboxes.index');
}
}
public function register(): void
{
$this->app->bind('in-app-notification', function () {
return new Jcergolj\InAppNotifications\InAppNotification(10000); // 10 seconds
});
}
// AppServiceProvider.php
InAppNotitication::macro('customMethod', function () {
});
// e.g. inside controller
InAppNotification::customMethod();
// add this for adding testable macro
InAppNotification::fake();
InAppNotification::assertSet()
InAppNotification::assertSet('Assert against this text.');
InAppNotification::assertSuccess()
InAppNotification::assertSuccess('Success');
InAppNotification::assertError();
InAppNotification::assertError('Error');
InAppNotification::assertInfo();
InAppNotification::assertInfo('Info');
InAppNotification::assertWarning();
InAppNotification::assertWarning('Warning');
InAppNotification::assertTimeout(10000);