{"id":25222785,"url":"https://github.com/benanamen/perfect-flash-bs-5","last_synced_at":"2026-04-14T00:01:57.622Z","repository":{"id":199368268,"uuid":"702730349","full_name":"benanamen/perfect-flash-bs-5","owner":"benanamen","description":"Bootstrap5FlashMessage is a PHP class that provides a simple and effective way to display flash messages in a web application. It uses Bootstrap 5 for styling and allows for optional icons and dismissible alerts.","archived":false,"fork":false,"pushed_at":"2023-10-10T01:56:24.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T17:59:14.664Z","etag":null,"topics":["bootstrap","flash-messages","php8"],"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/benanamen.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-09T22:35:07.000Z","updated_at":"2023-10-10T00:22:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"6cf7e850-d1c3-4bd1-8787-aca289d2f5bd","html_url":"https://github.com/benanamen/perfect-flash-bs-5","commit_stats":null,"previous_names":["benanamen/perfect-flash-bs-5"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/benanamen/perfect-flash-bs-5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benanamen%2Fperfect-flash-bs-5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benanamen%2Fperfect-flash-bs-5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benanamen%2Fperfect-flash-bs-5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benanamen%2Fperfect-flash-bs-5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benanamen","download_url":"https://codeload.github.com/benanamen/perfect-flash-bs-5/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benanamen%2Fperfect-flash-bs-5/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31776013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bootstrap","flash-messages","php8"],"created_at":"2025-02-10T23:42:59.382Z","updated_at":"2026-04-14T00:01:57.583Z","avatar_url":"https://github.com/benanamen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/benanamen/perfect-flash-bs-5/graph/badge.svg?token=FDt845yMbG)](https://codecov.io/gh/benanamen/perfect-flash-bs-5)\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/?branch=master)\n[![Build Status](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/badges/build.png?b=master)](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/build-status/master)\n[![Code Intelligence Status](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)\n\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n\n[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=benanamen_perfect-flash-bs-5\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)\n\n\n# Bootstrap5FlashMessage\n\n## Description\n\n`Bootstrap5FlashMessage` is a PHP class that provides a simple and effective way to display flash messages in a web application. It uses Bootstrap 5 for styling and allows for optional icons and dismissible alerts.\n\n## Requirements\n\n- PHP 8.0 or higher\n- Bootstrap 5.3 or higher\n\n## Installation\n\nInclude the `Bootstrap5FlashMessage` class in your project.\n\n## Usage\n\n### Initialization\n\nFirst, you need to inject a session object that implements `SessionInterface` and an array of messages into the constructor.\n\n```php\nuse PerfectApp\\Session\\SessionInterface;\nuse PerfectApp\\Bootstrap5FlashMessage;\n\n$session = new Session();  // This should implement SessionInterface\n$messages = [\n    'success' =\u003e [\n        'insert' =\u003e 'Record Inserted'\n    ],\n    'danger' =\u003e [\n        'failed_login' =\u003e 'Invalid Login'\n    ]\n];\n\n$flash = new Bootstrap5FlashMessage($session, $messages);\n```\n\n### Adding a Message\n\nTo add a flash message, use the `addMessage` method.\n\n```php\n$flash-\u003eaddMessage('success', 'insert');\n```\n\nYou can also add an optional icon and make the alert dismissible.\n\n```php\n$flash-\u003eaddMessage('danger', 'failed_login', 'bi-x-circle', true);\n```\n\n### Displaying Messages\n\nTo display all the flash messages, use the `displayMessages` method.\n\n```php\n$flash-\u003edisplayMessages();\n```\n\nThis will output Bootstrap 5 styled alerts.\n\n## Testing\n\nRun the following command to execute the unit tests and ensure 100% code coverage:\n\n```bash\nphp vendor/bin/codecept run --coverage --coverage-html  --coverage-xml\n```\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenanamen%2Fperfect-flash-bs-5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenanamen%2Fperfect-flash-bs-5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenanamen%2Fperfect-flash-bs-5/lists"}