{"id":28510383,"url":"https://github.com/devrabiul/laravel-toaster-magic","last_synced_at":"2025-10-23T16:41:57.947Z","repository":{"id":281250157,"uuid":"943188730","full_name":"devrabiul/laravel-toaster-magic","owner":"devrabiul","description":"Laravel Toaster Magic is a lightweight, flexible toast library for Laravel projects, with no jQuery, Bootstrap, or Tailwind dependency.","archived":false,"fork":false,"pushed_at":"2025-06-19T13:55:34.000Z","size":3111,"stargazers_count":168,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-19T14:49:34.219Z","etag":null,"topics":["laravel-toaster-magic","toaster-magic","toaster-magic-pro"],"latest_commit_sha":null,"homepage":"https://laravel-toaster-magic.rixetbd.com","language":"JavaScript","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/devrabiul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-05T09:59:57.000Z","updated_at":"2025-06-19T13:55:37.000Z","dependencies_parsed_at":"2025-04-29T20:26:50.989Z","dependency_job_id":"7afd1bfd-b5eb-4505-9570-42efa5b1d027","html_url":"https://github.com/devrabiul/laravel-toaster-magic","commit_stats":null,"previous_names":["devrabiul/laravel-toaster-magic"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/devrabiul/laravel-toaster-magic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrabiul%2Flaravel-toaster-magic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrabiul%2Flaravel-toaster-magic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrabiul%2Flaravel-toaster-magic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrabiul%2Flaravel-toaster-magic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devrabiul","download_url":"https://codeload.github.com/devrabiul/laravel-toaster-magic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrabiul%2Flaravel-toaster-magic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260774166,"owners_count":23060924,"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":["laravel-toaster-magic","toaster-magic","toaster-magic-pro"],"created_at":"2025-06-08T23:04:51.848Z","updated_at":"2025-10-23T16:41:57.941Z","avatar_url":"https://github.com/devrabiul.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🍞 ToastMagic - Laravel Toaster (With Livewire v3 Support)\n\nLaravel Toaster Magic is a lightweight and flexible toast notification package for Laravel applications — built with zero dependencies on jQuery, Bootstrap, or Tailwind.\nIt’s fully compatible with Livewire, supports custom events, and now features a Material-inspired design for a modern UX out of the box.\n\n[![Latest Stable Version](https://poser.pugx.org/devrabiul/laravel-toaster-magic/v/stable)](https://packagist.org/packages/devrabiul/laravel-toaster-magic)\n[![Total Downloads](https://poser.pugx.org/devrabiul/laravel-toaster-magic/downloads)](https://packagist.org/packages/devrabiul/laravel-toaster-magic)\n[![Monthly Downloads](https://poser.pugx.org/devrabiul/laravel-toaster-magic/d/monthly)](https://packagist.org/packages/devrabiul/laravel-toaster-magic)\n![GitHub license](https://img.shields.io/github/license/devrabiul/laravel-toaster-magic)\n[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/devrabiul/laravel-toaster-magic)\n![GitHub Repo stars](https://img.shields.io/github/stars/devrabiul/laravel-toaster-magic?style=social)\n\n---\n\n## 🚀 Live Demo\n\n👉 [Try the Live Demo](https://packages.rixetbd.com/devrabiul/laravel-toaster-magic)\n\n![Live Demo Thumbnail](https://packages.rixetbd.com/storage/app/public/package/devrabiul/laravel-toaster-magic.webp)\n\n---\n\n## ✨ Features\n\n- 🔥 **Easy-to-Use** – Simple and intuitive toast notifications for Laravel.\n- 🌍 **RTL Support** – Full compatibility with right-to-left (RTL) languages.\n- 🌙 **Dark Mode** – Seamless dark mode integration.\n- 🎨 **Customizable** – Tailor toasts with various styles, buttons, and positions.\n- ⚡ **Livewire v3 Ready** – Fully supports Livewire v3 with event-based dispatching.\n\n---\n\n## 📦 Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require devrabiul/laravel-toaster-magic\n````\n\nThen publish the package assets:\n\n```bash\nphp artisan vendor:publish --provider=\"Devrabiul\\ToastMagic\\ToastMagicServiceProvider\"\n```\n\n---\n\n## ⚙️ Usage\n\n### 1. Basic Setup\n\nInclude the necessary assets in your layout Blade template:\n\n**In the `\u003chead\u003e` section:**\n\n```php\n{!! ToastMagic::styles() !!}\n```\n\n**Before the closing `\u003c/body\u003e` tag:**\n\n```php\n{!! ToastMagic::scripts() !!}\n```\n\n**Example:**\n\n```blade\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n    \u003ctitle\u003ePage\u003c/title\u003e\n\n    {!! ToastMagic::styles() !!}\n\u003c/head\u003e\n\u003cbody\u003e\n\n    \u003c!-- Your Content --\u003e\n\n    {!! ToastMagic::scripts() !!}\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n---\n\n### 2. Usage in Controller\n\nTrigger toast notifications from your controllers using the `ToastMagic` facade:\n\n```php\nuse Devrabiul\\ToastMagic\\Facades\\ToastMagic;\n\npublic function store()\n{\n    // Your logic\n    ToastMagic::success('Successfully Created');\n    \n    // Another Way - message and description\n    ToastMagic::success(\"Success!\", \"Your data has been saved!\");\n    \n    // Another Way - message and description\n    ToastMagic::success(\"Success!\", \"Your data has been saved!\", [\n        'showCloseBtn' =\u003e true,\n        'customBtnText' =\u003e 'Link Text',\n        'customBtnLink' =\u003e 'https:/demo.com',\n    ]);\n    return back();\n}\n```\n\n---\n\n### 3. Usage in JavaScript (Optional)\n\nUse ToastMagic directly in JavaScript (for AJAX responses, etc.):\n\n```js\nconst toastMagic = new ToastMagic();\n\n// Basic notifications\ntoastMagic.success(\"Success!\", \"Your data has been saved!\");\ntoastMagic.error(\"Error!\", \"Something went wrong.\");\ntoastMagic.warning(\"Warning!\", \"Check your input.\", true);\ntoastMagic.info(\"Info!\", \"Click for details.\", false, \"Learn More\", \"https://example.com\");\n```\n\n---\n\n### 4. ✅ Livewire v3 Support\n\nEnable Livewire support by updating your config file:\n\n```php\n// config/laravel-toaster-magic.php\n\nreturn [\n    'options' =\u003e [\n        // your toast options...\n    ],\n    'livewire_enabled' =\u003e true,\n    'livewire_version' =\u003e 'v3',\n];\n```\n\n* Set `'livewire_enabled' =\u003e true` to activate Livewire integration.\n* Set `'livewire_version' =\u003e 'v3'` to specify the Livewire version.\n\n---\n\n**Dispatch toast notifications from Livewire components:**\n\n```php\n$this-\u003edispatch('toastMagic',\n    status: 'success',\n    title: 'User Created',\n    message: 'The user has been successfully created.',\n    options: [\n        'showCloseBtn' =\u003e true,\n        'customBtnText' =\u003e 'Link Text',\n        'customBtnLink' =\u003e 'https:/demo.com',\n    ],\n);\n\n$this-\u003edispatch('toastMagic',\n    status: 'info',\n    title: 'User Created 2',\n    message: 'The user has been successfully created.'\n);\n```\n\n**Supported status types:** `success`, `info`, `warning`, `error`\n\n---\n\n### 5. ✅ Themes\n\nChange Theme by updating your config file:\n\n```php\n// config/laravel-toaster-magic.php\n\nreturn [\n    'options' =\u003e [\n        // your toast options..\n        \"theme\" =\u003e \"material\", // \"default, material\".\n    ],\n    // your toast options..\n];\n```\n\n---\n\n### 6. 🎨 Enabling Color Mode\n\nToastMagic supports a **color mode** that dynamically applies toast colors based on the toast type (`success`, `error`, `warning`, `info`). This makes your notifications visually consistent and meaningful without manually specifying colors or themes.\n\nEnable color mode in your configuration file `config/laravel-toaster-magic.php`:\n\n```php\nreturn [\n    'options' =\u003e [\n        // other options...\n        'color_mode' =\u003e true, // Automatically apply colors based on toast type\n    ],\n    'livewire_enabled' =\u003e false,\n    'livewire_version' =\u003e 'v3',\n];\n```\n\n### 7. 🎨 Enabling Gradient Mode\n\nLaravel Toaster Magic now supports a **gradient mode**, which dynamically applies toast colors based on the toast type (`success`, `error`, `warning`, `info`). This ensures that your notifications are visually consistent and meaningful **without manually specifying colors or themes**.\n\nTo enable gradient mode, update your configuration file `config/laravel-toaster-magic.php`:\n\n```php\nreturn [\n    'options' =\u003e [\n        // other options...\n        \"gradient_enable\" =\u003e true, // Only available for default and material themes\n    ],\n    'livewire_enabled' =\u003e false,\n    'livewire_version' =\u003e 'v3',\n];\n```\n\n\u003e **Note:** Gradient mode works only with the **default** and **material** themes.\n\n---\n\n## 🧩 Alternative Syntax \u0026 Fluent API\n\nToastMagic provides both simple and advanced APIs to suit your style.\n\n### 🔹 Static Method (Quick)\n\n```php\nuse Devrabiul\\ToastMagic\\Facades\\ToastMagic;\n\nToastMagic::success('Operation Successful');\nToastMagic::error('Something went wrong');\n```\n\n### 🔹 Fluent Syntax (Advanced)\n\n```php\nToastMagic::dispatch()-\u003esuccess(\n    'User Created',\n    'The user has been successfully created.',\n    [\n        'showCloseBtn'    =\u003e true,\n        'customBtnText'   =\u003e 'View Profile',\n        'customBtnLink'   =\u003e 'https://demo.com',\n    ]\n);\n```\n---\n\n## 📍 Toast Position Options\n\nCustomize toast display position using any of the following:\n\n| Position              | Description                |\n| --------------------- | -------------------------- |\n| `toast-top-start`     | Top left corner            |\n| `toast-top-end`       | Top right corner (default) |\n| `toast-top-center`    | Top center                 |\n| `toast-bottom-start`  | Bottom left corner         |\n| `toast-bottom-end`    | Bottom right corner        |\n| `toast-bottom-center` | Bottom center              |\n\n---\n\n\n## 🌙 Enable Dark Mode\n\nAdd `theme=\"dark\"` to your `\u003cbody\u003e` tag to automatically enable dark mode.\n\n```html\n\u003cbody theme=\"dark\"\u003e\n```\n\n\n## 🎯 Get Started Today!\n\nExperience the magic of ToastMagic and enrich your Laravel application with modern, elegant toast notifications.\n\n* 🔗 **GitHub:** [devrabiul/laravel-toaster-magic](https://github.com/devrabiul/laravel-toaster-magic)\n* 🔗 **Live Demo:** [laravel-toaster-magic.rixetbd.com](https://laravel-toaster-magic.rixetbd.com)\n* 🔗 **Packagist:** [packagist.org/packages/devrabiul/laravel-toaster-magic](https://packagist.org/packages/devrabiul/laravel-toaster-magic)\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions!\nPlease fork the repository, make your changes, and submit a pull request.\nFor feature requests or issues, [open a GitHub issue](https://github.com/devrabiul/laravel-toaster-magic/issues).\n\n---\n\n## 📄 License\n\nThis package is open-source software licensed under the [MIT license](LICENSE).\n\n---\n\n## 🌱 Treeware\n\nThis package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/devrabiul/laravel-toaster-magic) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.\n\n---\n\n## 📬 Contact\n\nFor support or inquiries, feel free to reach out:\n📧 [devrabiul@gmail.com](mailto:devrabiul@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevrabiul%2Flaravel-toaster-magic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevrabiul%2Flaravel-toaster-magic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevrabiul%2Flaravel-toaster-magic/lists"}