{"id":13527834,"url":"https://github.com/illuminate/database","last_synced_at":"2025-05-13T15:03:45.517Z","repository":{"id":3497972,"uuid":"4554599","full_name":"illuminate/database","owner":"illuminate","description":"[READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework)","archived":false,"fork":false,"pushed_at":"2025-05-05T02:00:12.000Z","size":11873,"stargazers_count":2717,"open_issues_count":0,"forks_count":601,"subscribers_count":114,"default_branch":"master","last_synced_at":"2025-05-05T22:41:29.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"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/illuminate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2012-06-05T01:43:19.000Z","updated_at":"2025-05-01T07:15:02.000Z","dependencies_parsed_at":"2023-09-25T03:57:00.327Z","dependency_job_id":"7e8a5a72-ef9e-4093-a775-7f5ed118fe16","html_url":"https://github.com/illuminate/database","commit_stats":{"total_commits":5716,"total_committers":1434,"mean_commits":"3.9860529986052997","dds":0.814555633310007,"last_synced_commit":"586cf8c7a67bc5371e1a7e59c17b8cd3f68d2eaf"},"previous_names":[],"tags_count":893,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illuminate%2Fdatabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illuminate%2Fdatabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illuminate%2Fdatabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/illuminate%2Fdatabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/illuminate","download_url":"https://codeload.github.com/illuminate/database/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253206173,"owners_count":21871165,"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-08-01T06:02:03.181Z","updated_at":"2025-05-13T15:03:45.485Z","avatar_url":"https://github.com/illuminate.png","language":"PHP","readme":"## Illuminate Database\n\nThe Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL, Postgres, SQL Server, and SQLite. It also serves as the database layer of the Laravel PHP framework.\n\n### Usage Instructions\n\nFirst, create a new \"Capsule\" manager instance. Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible.\n\n```PHP\nuse Illuminate\\Database\\Capsule\\Manager as Capsule;\n\n$capsule = new Capsule;\n\n$capsule-\u003eaddConnection([\n    'driver' =\u003e 'mysql',\n    'host' =\u003e 'localhost',\n    'database' =\u003e 'database',\n    'username' =\u003e 'root',\n    'password' =\u003e 'password',\n    'charset' =\u003e 'utf8',\n    'collation' =\u003e 'utf8_unicode_ci',\n    'prefix' =\u003e '',\n]);\n\n// Set the event dispatcher used by Eloquent models... (optional)\nuse Illuminate\\Events\\Dispatcher;\nuse Illuminate\\Container\\Container;\n$capsule-\u003esetEventDispatcher(new Dispatcher(new Container));\n\n// Make this Capsule instance available globally via static methods... (optional)\n$capsule-\u003esetAsGlobal();\n\n// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())\n$capsule-\u003ebootEloquent();\n```\n\n\u003e `composer require \"illuminate/events\"` required when you need to use observers with Eloquent.\n\nOnce the Capsule instance has been registered. You may use it like so:\n\n**Using The Query Builder**\n\n```PHP\n$users = Capsule::table('users')-\u003ewhere('votes', '\u003e', 100)-\u003eget();\n```\nOther core methods may be accessed directly from the Capsule in the same manner as from the DB facade:\n```PHP\n$results = Capsule::select('select * from users where id = ?', [1]);\n```\n\n**Using The Schema Builder**\n\n```PHP\nCapsule::schema()-\u003ecreate('users', function ($table) {\n    $table-\u003eincrements('id');\n    $table-\u003estring('email')-\u003eunique();\n    $table-\u003etimestamps();\n});\n```\n\n**Using The Eloquent ORM**\n\n```PHP\nclass User extends Illuminate\\Database\\Eloquent\\Model {}\n\n$users = User::where('votes', '\u003e', 1)-\u003eget();\n```\n\nFor further documentation on using the various database facilities this library provides, consult the [Laravel framework documentation](https://laravel.com/docs).\n","funding_links":[],"categories":["Table of Contents","PHP","数据库","目录","数据库 Database","ORM and Datamapping","Database","数据库( Database )"],"sub_categories":["Database","数据库 Database"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filluminate%2Fdatabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filluminate%2Fdatabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filluminate%2Fdatabase/lists"}