{"id":18412914,"url":"https://github.com/skrajewski/laravel-flash-notifications","last_synced_at":"2025-04-07T11:32:15.376Z","repository":{"id":18514820,"uuid":"21711866","full_name":"skrajewski/laravel-flash-notifications","owner":"skrajewski","description":"Flash Notifications Helper for Laravel Framework","archived":false,"fork":false,"pushed_at":"2016-01-22T17:32:40.000Z","size":24,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T22:17:56.598Z","etag":null,"topics":["alert","facade","flash-notifications","laravel","php"],"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/skrajewski.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":"2014-07-10T22:02:22.000Z","updated_at":"2021-12-02T09:25:36.000Z","dependencies_parsed_at":"2022-07-30T14:19:47.855Z","dependency_job_id":null,"html_url":"https://github.com/skrajewski/laravel-flash-notifications","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrajewski%2Flaravel-flash-notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrajewski%2Flaravel-flash-notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrajewski%2Flaravel-flash-notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrajewski%2Flaravel-flash-notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skrajewski","download_url":"https://codeload.github.com/skrajewski/laravel-flash-notifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247644576,"owners_count":20972317,"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":["alert","facade","flash-notifications","laravel","php"],"created_at":"2024-11-06T03:44:06.451Z","updated_at":"2025-04-07T11:32:14.203Z","avatar_url":"https://github.com/skrajewski.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Laravel Flash Notifications\n===========================\n[![build](https://img.shields.io/travis/skrajewski/laravel-flash-notifications.svg)](https://travis-ci.org/skrajewski/laravel-flash-notifications)\n[![version](https://img.shields.io/packagist/v/szykra/laravel-flash-notifications.svg)](https://packagist.org/packages/szykra/laravel-flash-notifications)\n![license](https://img.shields.io/packagist/l/szykra/laravel-flash-notifications.svg)\n![downloads](https://img.shields.io/packagist/dm/szykra/laravel-flash-notifications.svg)\n\nFlash Notifications Helper for Laravel 5\n\n## Install\n\n### Install via composer\n\nAdd dependency to your `composer.json` file and run `composer update`.\n\n```\nrequire: {\n    \"szykra/laravel-flash-notifications\": \"~0.3\"\n}\n```\n\n### Configure Laravel\n\nAdd ServiceProvider and Alias _(Facade)_ to your `config/app.php` file:\n\n```php\n'Szykra\\Notifications\\NotificationServiceProvider'\n```\n\n```php\n'Flash' =\u003e 'Szykra\\Notifications\\Flash'\n```\n\n### Include default alert view to your layout\n\nPackage default provides _bootstrap ready_ alert view. Just include `notifications::flash` file to your main layout in blade:\n\n```php\n@include('notifications::flash')\n````\n\nYou can create own container for flash notifications with own custom styles. See _Custom alert view_ section.\n\n## Usage\n\nYou can push flash message ever you need by facade `Flash`. It provides 4 alert types:\n\n* success\n* error\n* warning\n* info\n\n```php\nFlash::info('Your alert message here!');\n```\n\n~~Method `push()` exists because you can push more than one alert at the same time. _See below_.~~\n\nEvery alert method takes 1 or 2 arguments. If you give one parameter it will be _message_. If you provide two parameters, first will be _title_ and second will be _message_.\n\n```php\nFlash::success('User has been updated successfully.');\nFlash::error('Oh snap!', 'Something went wrong. Please try again for a few seconds.');\n```\n\n## Custom alert view\n\nPackage default provides _bootstrap ready_ view for alerts. You can define own style for it. \nJust create new _blade_ template file!\n\n```php\n@if(Session::has('flash.alerts'))\n    @foreach(Session::get('flash.alerts') as $alert)\n\n        \u003cdiv class='alert alert-{{ $alert['level'] }}'\u003e\n            \u003cbutton class=\"close\" type=\"button\" data-dismiss=\"alert\" aria-hidden=\"true\"\u003e\u0026times;\u003c/button\u003e\n\n            @if( ! empty($alert['title']))\n                \u003cdiv\u003e\u003cstrong\u003e{{ $alert['title'] }}\u003c/strong\u003e\u003c/div\u003e\n            @endif\n\n            {{ $alert['message'] }}\n        \u003c/div\u003e\n\n    @endforeach\n@endif\n```\n\nAll alerts will be in `flash.alerts` session variable. Single alert looks like:\n\n```php\n[\n  'title' =\u003e 'Title',\n  'message' =\u003e 'Example message',\n  'level' =\u003e 'success'\n]\n```\n\n_Level_ for all alerts are following:\n\n* `Flash::success` has level _success_\n* `Flash::error` has level _danger_\n* `Flash::warning` has level _warning_\n* `Flash::info` has level _info_\n\n## License\n\nThe MIT License. Copyright (c) 2014 - 2015 Szymon Krajewski.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskrajewski%2Flaravel-flash-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskrajewski%2Flaravel-flash-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskrajewski%2Flaravel-flash-notifications/lists"}