{"id":34532729,"url":"https://github.com/pyaesone17/laravel-pretty-handler","last_synced_at":"2026-04-24T14:34:37.425Z","repository":{"id":57046135,"uuid":"92258592","full_name":"pyaesone17/laravel-pretty-handler","owner":"pyaesone17","description":"Advance Laravel Model Not Found Exception Handler ","archived":false,"fork":false,"pushed_at":"2017-05-24T13:19:06.000Z","size":260,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-21T10:14:43.605Z","etag":null,"topics":["error-handler","error-reporting","exception-handler","laravel","laravel-5-package","laravel5-package","model-not-found"],"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/pyaesone17.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-24T06:36:54.000Z","updated_at":"2019-10-23T21:35:32.000Z","dependencies_parsed_at":"2022-08-24T05:00:21.526Z","dependency_job_id":null,"html_url":"https://github.com/pyaesone17/laravel-pretty-handler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pyaesone17/laravel-pretty-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaesone17%2Flaravel-pretty-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaesone17%2Flaravel-pretty-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaesone17%2Flaravel-pretty-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaesone17%2Flaravel-pretty-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyaesone17","download_url":"https://codeload.github.com/pyaesone17/laravel-pretty-handler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyaesone17%2Flaravel-pretty-handler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32227739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"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":["error-handler","error-reporting","exception-handler","laravel","laravel-5-package","laravel5-package","model-not-found"],"created_at":"2025-12-24T05:52:28.801Z","updated_at":"2026-04-24T14:34:37.420Z","avatar_url":"https://github.com/pyaesone17.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Pretty Handler\n\nThe package will allow you to define the error view based on model and based on the request.\n\n**Frontend view of Shop Model Not Found Exception**\n\n![Frontend Example](https://raw.githubusercontent.com/pyaesone17/laravel-pretty-handler/master/examples/1st.png)\n\n**Backend view of Shop Model Not Found Exception**\n\n![Backend Example](https://raw.githubusercontent.com/pyaesone17/laravel-pretty-handler/master/examples/2nd.png)\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require pyaesone17/laravel-pretty-handler\n```\n## Usage\nFirstly register the serviceprovider in config/app.php like this\n\n``` php\n   [ ....\n       Pyaesone17\\LaravelPrettyHandler\\PrettyServiceProvider::class       \n   ],\n\n```\n\nResolve **\\Pyaesone17\\LaravelPrettyHandler\\PrettyHandler** like this in the render method of App\\Exceptions\\Handler.\n\n``` php\n\n$prettyResponse = ( resolve(\\Pyaesone17\\LaravelPrettyHandler\\PrettyHandler::class)) ($e);\n\nif($prettyResponse){\n    return $prettyResponse;\n}\n\n```\n\nIn the model you have to implement **\\Pyaesone17\\LaravelPrettyHandler\\Pretty** trait and set up using setUp method.\n\n**prettyDefaultView** will be default view of the App\\User not found exception.\n\n**prettyRules** will accept the array list with url and view.\n\nIn the following example, if the exception occurs in admin section errors.backend page will show.\n\nIf request does not match any url value, it will show default page of the Model that is defined in prettyDefaultView.\n\n``` php\n\nclass User extends Model\n{\n    use Pretty;\n\n    public function setUpPretty()\n    {\n        $this-\u003eprettyDefaultView = 'errors.coming';\n        $this-\u003eprettyRules = [\n            ['url' =\u003e 'admin/*','view' =\u003e 'errors.backend'],\n            ['url' =\u003e 'frontend/*','view' =\u003e 'errors.frontend'],\n            ['url' =\u003e 'shop/*', 'view' =\u003e 'errors.coming']\n        ];\n    } \n}\n\n```\n## Note\nDo not use  **\\Pyaesone17\\LaravelPrettyHandler\\PrettyHandler::class** directly in Handler because it recieve constructor value from the Service Container.\n\nYou have to resolve the class fromn the container.\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyaesone17%2Flaravel-pretty-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyaesone17%2Flaravel-pretty-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyaesone17%2Flaravel-pretty-handler/lists"}