{"id":15698207,"url":"https://github.com/zofe/deficient","last_synced_at":"2026-03-16T08:33:23.839Z","repository":{"id":22110480,"uuid":"25440927","full_name":"zofe/deficient","owner":"zofe","description":"subset of laravel components, an easy way to get up and running eloquent, validations, translations and blade in your application","archived":false,"fork":false,"pushed_at":"2014-10-31T23:13:19.000Z","size":398,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T01:11:25.207Z","etag":null,"topics":[],"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/zofe.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-10-19T21:32:03.000Z","updated_at":"2016-05-26T05:05:05.000Z","dependencies_parsed_at":"2022-08-20T20:10:59.870Z","dependency_job_id":null,"html_url":"https://github.com/zofe/deficient","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zofe%2Fdeficient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zofe%2Fdeficient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zofe%2Fdeficient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zofe%2Fdeficient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zofe","download_url":"https://codeload.github.com/zofe/deficient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171269,"owners_count":21865297,"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":[],"created_at":"2024-10-03T19:23:52.577Z","updated_at":"2026-03-16T08:33:23.798Z","avatar_url":"https://github.com/zofe.png","language":"PHP","readme":"Deficient\n============\n\nDeficient give you some of laravel components, without the entire environment.  \nYou can also add some other package because I keepd the IOC and service-provider booting.  \nIt has also some helper to keep a concise syntax.\n\nBasically you'll get:\n\n - eloquent\n - validation\n - translation\n - blade\n - [burp](https://github.com/zofe/burp) (a tiny, non blocking, router)\n  \n## why\n\nIn some cases, with big projects, you can't switch to Laravel from start, you need to move step by step, section by section. In some other, you need just a great ORM, or/and template engine, or form validation, translations.. but not a \"framework\".\n\nThink to \"deficient\" as a way to use laravel without move to laravel, or (better) a way to embrace laravel slowly and quietly using each component when, where and how you like in your current app.  \n\nOn the other hand:\n - deficient make a vendor of __3.5 mb__\n - laravel build a vendor of __20 mb__  \n \n (using illuminate components of 4.1 --prefer-dist version for both)\n\n\n## Installation\n\ninstall via composer creating or adding dependency to your composer.json:\n\n```\n{\n    \"require\": {\n        \"zofe/deficient\": \"dev-master\"\n    }\n}\n```\n\nthen running ```composer install```\n\n\n## usage \n\n\nyou can setup a basic file structure, to store configurations, views, language files, and models.  \nThe suggestd one is: \n\n    /config\n        app.php\n        database.php\n    /lang\n        /en\n           validation.php\n    /models\n        User.php\n    /cache\n    /views\n        hello.blade.php\n\n\nTo create this structure you can simply run a setup command:  \n(__important__: be sure that you've no folders conflict with your current application)\n\n    php vendor/zofe/deficient/deficient setup:folders\n    \nYou must set write permission to /cache folder.  \nThen you can make an index.php in your root or use Deficient where you want in your project:\n\n\n```php\n\n\u003c?php\n#index.php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\nuse Zofe\\Deficient\\Deficient;\n\n\n//booting from current directory (needed to find config and other folders)\nDeficient::boot(\"./\");\n\n//db stuff\n$results = select('select * from mytable');\n\n//validation\n$validator = validator(array('title'=\u003e'abc','description'=\u003e'description bla b...'), \n                       array('title'=\u003e'required|min:4','description'=\u003e'required'));\nif ($validator-\u003efails()){\n    dd( $validator-\u003emessages() );\n}\n\n//translation (return 'thankyou' value @ current locale: /lang/en/messages.php )\necho trans('messages.thankyou');\n\n//eloquent\n$users = User::all();\n\n//blade\necho blade('hello', compact('results','users'));\n```\n## Laravel Facades\nYou can also use laravel Facades, declaring or using full namespaces, i.e.:\n\n```php\n\u003c?php\n\nuse Zofe\\Deficient\\Deficient;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Illuminate\\Support\\Facades\\DB;\n...\n\n$validator = Validator::make(....\n$results = DB::select(....\n\n```\n## Need a Router?  \nDeficient comes without laravel router, but it has simple alternative: [burp](https://github.com/zofe/burp) router.  \nSo you can do something like this:\n\n```php\n..\n\nDeficient::boot(\"./\");\n\nroute_get('^/user/(\\d+)$', function( $id ) {\n    $user = User::find($id);\n    echo blade('user_detail', compact('user'));\n});\n\nroute_post('^/user/(\\d+)$', function( $id ) {\n    $user = User::find($id)-\u003eupdate($_POST);\n    echo blade('user_detail', compact('user'));\n});\n\nroute_missing(function() {\n    echo blade('error', array(), 404);\n    die;\n});\n\nroute_dispatch();\n\n```\n\nTo create a basic index.php, .htaccess, and some route you can use this command  \n(__important__: be sure that you've no index.php and .htaccess in your current application)\n\n    php vendor/zofe/deficient/deficient setup:router\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzofe%2Fdeficient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzofe%2Fdeficient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzofe%2Fdeficient/lists"}