{"id":15296343,"url":"https://github.com/oachoor/ratingbundle","last_synced_at":"2026-03-17T17:34:35.051Z","repository":{"id":57029744,"uuid":"135290142","full_name":"oachoor/RatingBundle","owner":"oachoor","description":"Rating system for Symfony4","archived":false,"fork":false,"pushed_at":"2019-12-19T11:53:01.000Z","size":68,"stargazers_count":5,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T10:21:18.912Z","etag":null,"topics":["php71","rating","symfony4","vote"],"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/oachoor.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":"2018-05-29T12:05:59.000Z","updated_at":"2023-03-06T22:53:30.000Z","dependencies_parsed_at":"2022-08-23T17:40:50.340Z","dependency_job_id":null,"html_url":"https://github.com/oachoor/RatingBundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oachoor%2FRatingBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oachoor%2FRatingBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oachoor%2FRatingBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oachoor%2FRatingBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oachoor","download_url":"https://codeload.github.com/oachoor/RatingBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248770507,"owners_count":21158990,"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":["php71","rating","symfony4","vote"],"created_at":"2024-09-30T18:10:10.317Z","updated_at":"2026-03-17T17:34:34.996Z","avatar_url":"https://github.com/oachoor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RatingBundle :star:\n\nThis Symfony bundle provides integration of a star rating system.\n\n### Requirements\n\n* PHP 7.2+\n* MySQL 5.7.20+\n* Symfony 4.3+\n\n### :package: Installation\n\nInstall bundle with `Composer` dependency manager first by running the command:\n\n`$ composer req oachoor/rating-bundle`\n\n### Add routes\n\n``` yaml\noa_rating:\n    resource: '@RatingBundle/Controller'\n    type: annotation\n```\n \n### (Optional) Create your own Entities \n\nEntities doesn't fully meet your requirements?, then you can create yours based on [Rating](Entity/Rating.php) and [Vote](Entity/Vote.php).\n\n### Resolve abstract Entities with RatingBundle or your custom ones\n\n``` yaml\ndoctrine:\n    orm:\n        resolve_target_entities:\n            RatingBundle\\Model\\AbstractVote: RatingBundle\\Entity\\Vote or AcmeRatingBundle\\Entity\\Vote\n            RatingBundle\\Model\\AbstractRating: RatingBundle\\Entity\\Rating or AcmeRatingBundle\\Entity\\Rating\n            Symfony\\Component\\Security\\Core\\User\\UserInterface: RatingBundle\\Entity\\User or AcmeRatingBundle\\Entity\\User\n```\n\n### Define mapping Bundle\n\nMake sure you have registered the Bundle that holds the Entities as following:\n\n``` yaml\ndoctrine:\n    orm:\n        entity_managers:\n            default:\n                mappings:\n                    RatingBundle: ~ or AcmeRatingBundle: ~\n```\n\n### Update database schema\n\n``` bash\n$ bin/console doctrine:schema:update --force --no-debug\n```\n\n### Using voting strategy\n\nThere are two strategies for rating, based on IP addresses or cookies. (both? feel free to contribute)\n\n``` yaml\noa_rating:\n    strategy: cookie (default \"ip\")\n    cookie_name: your_custom_name\n    cookie_lifetime: '+1 year'\n```\n\n### Templates customization \n\nTemplates can be overridden in the `\u003cyour-project\u003e/templates/bundles/RatingBundle/` directory, the new templates must use the same name and path (relative to `RatingBundle/Resources/views/`) as the original templates.\n\nTo override the `Resources/views/rating/view.html.twig` template, create this template: `\u003cyour-project\u003e/templates/bundles/RatingBundle/rating/view.html.twig`\n\n### Usage\n\nTo see rating result for a Content (read-only mode), use the following twig code:\n\n``` twig\n{{ render( controller( 'RatingBundle:Rating:result', {'contentId': yourContentId} ) ) }}\n```\n\nRating is based on Content, to enable voting for a Content use the following twig code:\n\n``` twig\n{{ render( controller( 'RatingBundle:Rating:vote', {'contentId': yourContentId} ) ) }}\n```\n\n### Example\n\nA minimal [Template](Resources/views/rating/view.html.twig) that contains rating-call, javascripts and stylesheets.\n\n## Todos\n\n- [ ] Make User dependencies optional.\n- [ ] Write some Unit Tests.\n- [ ] Add Fixtures.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foachoor%2Fratingbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foachoor%2Fratingbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foachoor%2Fratingbundle/lists"}