{"id":21599781,"url":"https://github.com/mujhtech/laravel-navtoastr","last_synced_at":"2026-05-11T16:36:51.034Z","repository":{"id":57021828,"uuid":"379552280","full_name":"Mujhtech/laravel-navtoastr","owner":"Mujhtech","description":"NavToastr Notifications and Custom Redirection for Laravel App","archived":false,"fork":false,"pushed_at":"2021-06-25T09:45:52.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T05:45:40.674Z","etag":null,"topics":["flash","laravel","navtoastr","notification","php","redirection","toastr"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mujhtech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-23T09:40:58.000Z","updated_at":"2021-06-26T21:13:13.000Z","dependencies_parsed_at":"2022-08-23T13:51:02.703Z","dependency_job_id":null,"html_url":"https://github.com/Mujhtech/laravel-navtoastr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mujhtech%2Flaravel-navtoastr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mujhtech%2Flaravel-navtoastr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mujhtech%2Flaravel-navtoastr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mujhtech%2Flaravel-navtoastr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mujhtech","download_url":"https://codeload.github.com/Mujhtech/laravel-navtoastr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244217639,"owners_count":20417660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flash","laravel","navtoastr","notification","php","redirection","toastr"],"created_at":"2024-11-24T18:16:27.794Z","updated_at":"2026-05-11T16:36:50.986Z","avatar_url":"https://github.com/Mujhtech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eNavToastr Notifications and Custom Redirection for Laravel App\u003c/h1\u003e\n\n\u003e \u003cp align=\"center\"\u003e\u003cimg src=\"https://res.cloudinary.com/mujhtech/image/upload/v1624612971/A_powerful_and_flexible_flash_notification_with_custom_redirection_ru5rz3.png\"\u003e\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e:eyes: This package helps you to add \u003ca href=\"https://github.com/ireade/Toast.js\"\u003eToast.js\u003c/a\u003e notifications to your Laravel app\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://packagist.org/packages/mujhtech/nav-toastr\"\u003e\u003cimg src=\"http://poser.pugx.org/mujhtech/nav-toastr/v\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/mujhtech/nav-toastr\"\u003e\u003cimg src=\"http://poser.pugx.org/mujhtech/nav-toastr/v/unstable\" alt=\"Latest Unstable Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://scrutinizer-ci.com/g/Mujhtech/laravel-navtoastr/build-status/master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/Mujhtech/laravel-navtoastr/badges/build.png?b=master\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://scrutinizer-ci.com/g/Mujhtech/laravel-navtoastr/?branch=master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/Mujhtech/laravel-navtoastr/badges/quality-score.png?b=master\" alt=\"Scrutinizer Code Quality\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://scrutinizer-ci.com/g/Mujhtech/laravel-navtoastr/?branch=master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/Mujhtech/laravel-navtoastr/badges/coverage.png?b=master\" alt=\"Code Coverage\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/mujhtech/nav-toastr\"\u003e\u003cimg src=\"http://poser.pugx.org/mujhtech/nav-toastr/downloads\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/mujhtech/nav-toastr\"\u003e\u003cimg src=\"http://poser.pugx.org/mujhtech/nav-toastr/license\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n\n## Install\n\nYou can install the package using composer\n\n```sh\n$ composer require mujhtech/nav-toastr\n```\n\nThen add the service provider to `config/app.php`. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.\n\n```php\n'providers' =\u003e [\n    ...\n    Mujhtech\\NavToastr\\NavToastrServiceProvider::class\n    ...\n];\n```\n\nTo install the configuration and assets file run:\n \n```sh\n$ php artisan navtoastr:install\"\n```\n\n## Usage:\n\nInclude [app.css] and [app.js](https://github.com/ireade/Toast.js) in your view template: \n\n1. Link to app.css `\u003clink href=\"src/Toast.css\" rel=\"stylesheet\"/\u003e` or `@navtoastrCss`\n2. Link to app.js `\u003cscript src=\"src/Toast.js\"\u003e\u003c/script\u003e` or `@navtoastrJs` \n\n4. use `navtoastr()` helper function inside your controller to set a toast notification for info, success, warning or error\n```php\n// Display an info toast with no title\nnavtoastr()-\u003einfo('Are you the 6 fingered man?')\n```\n\nas an example:\n```php\n\u003c?php\n\nnamespace App\\Http\\Controllers;\n\nuse App\\User;\nuse App\\Http\\Requests\\PostRequest;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass UserController extends Controller\n{\n    public function store(UserRequest $request)\n    {\n        $post = User::create($request-\u003eonly(['username', 'password']));\n\n        if ($post instanceof Model) {\n\n            navtoastr()-\u003esuccess('Data has been saved successfully!');\n\n            return navtoastr()-\u003enamed('posts.index');\n        }\n\n        navtoastr()-\u003eerror('An error has occurred please try again later.');\n\n        return navtoastr()-\u003eback();\n    }\n}\n```\n\nAfter that add the `@navtoastrRender` at the bottom of your view to actualy render the nav-toastr notifications.\n\n```blade\n\u003c!doctype html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eNav Toastr.js\u003c/title\u003e\n        @navtoastrCss\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \n    \u003c/body\u003e\n    @navtoastrJs\n    @navtoastrRender\n\u003c/html\u003e\n```\n### Other Options\n\n```php\n// Set a info toast\nnavtoastr()-\u003einfo('My name is Muhideen Mujeeb')\n\n// Set a success toast\nnavtoastr()-\u003esuccess('Have fun storming the castle!')\n\n// Set an error toast\nnavtoastr()-\u003eerror('I do not think that word means what you think it means.')\n\n// Set an warning toast\n\nnavtoastr()-\u003ewarning('We do have the Kapua suite available.')\n```\n### Other api methods:\n// You can also chain multiple messages together using method chaining\n```php\nnavtoastr()-\u003einfo('Are you the 6 fingered man?')-\u003esuccess('Have fun storming the castle!')-\u003ewarning('doritos');\n```\n\n// you could replace `@navtoastrRender` by :\n```php \nnavtoastr()-\u003erender() or app('nav-toastr')-\u003erender()\n```\n\n// you can use `navtoastr('')` instead of `navtoastr()-\u003esuccess()`\n```php\nfunction toastr(string $message = null, string $type = 'success', string $title = '', bool $enableCustomButton = false);\n```\n\nso\n\n* `navtoastr($message)` is equivalent to `navtoastr()-\u003esuccess($message)`\n* `navtoastr($message, 'info', true)` is equivalent to `navtoastr()-\u003einfo($message, true)`\n* `navtoastr($message, 'warning', true)` is equivalent to `navtoastr()-\u003ewarning($message, true)`\n* `navtoastr($message, 'error', false) ` is equivalent to `navtoastr()-\u003eerror($message, false)`\n\n### configuration:\n```php\n// config/nav-toastr.php\n\u003c?php\n\nreturn [\n    \n    'custombuttons' =\u003e [\n        [\n            'text'      =\u003e 'Refresh the page',\n            'reload'    =\u003e true\n        ],\n        [\n            'text'      =\u003e 'My Website',\n            'url'       =\u003e 'https://mujh.tech'\n        ],\n        [\n            'text'      =\u003e 'Twitter',\n            'url'       =\u003e 'https://twitter.com/mujhtech'\n        ]\n    ],\n];\n```\n\n## Credits\n\n- [Mujhtech](https://github.com/mujhtech)\n- [Ire Aderinokun](https://github.com/ireade)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujhtech%2Flaravel-navtoastr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmujhtech%2Flaravel-navtoastr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujhtech%2Flaravel-navtoastr/lists"}