PHPackages                             uedehua/laravel5-doctrine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. uedehua/laravel5-doctrine

ActiveProject[Framework](/categories/framework)

uedehua/laravel5-doctrine
=========================

The Doctrine Orm Form Laravel Framework.

5.1.x-dev(10y ago)00MITPHPPHP &gt;=5.5.9

Since Jul 12Pushed 10y ago1 watchersCompare

[ Source](https://github.com/uedehua/laravel5-doctrine)[ Packagist](https://packagist.org/packages/uedehua/laravel5-doctrine)[ RSS](/packages/uedehua-laravel5-doctrine/feed)WikiDiscussions 5.1 Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Doctrine 2 for Laravel5
=======================

[](#doctrine-2-for-laravel5)

[![Latest Stable Version](https://camo.githubusercontent.com/fe5f51e22c70bd936d7bf35c6785866e2e05c211b86708646a59ac1be88e0620/68747470733a2f2f706f7365722e707567782e6f72672f756564656875612f6c61726176656c352d646f637472696e652f76657273696f6e2e706e67)](https://packagist.org/packages/uedehua/laravel5-doctrine)[![License](https://camo.githubusercontent.com/cbcb530d669598323b39cd8648080eba9bfd0d77df823088784e13e7df3b9411/68747470733a2f2f706f7365722e707567782e6f72672f756564656875612f6c61726176656c352d646f637472696e652f6c6963656e73652e706e67)](https://packagist.org/packages/uedehua/laravel5-doctrine)[![Total Downloads](https://camo.githubusercontent.com/7d356075187a0ae20068cd6a457c09ba7ff79520ac085289319a8afd9122bce9/68747470733a2f2f706f7365722e707567782e6f72672f756564656875612f6c61726176656c352d646f637472696e652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/uedehua/laravel5-doctrine)

A Doctrine 2 implementation that melts with Laravel 5.1.X.

Documentation
-------------

[](#documentation)

Begin reading [the full documentation](https://github.com/uedehua/laravel5-doctrine/wiki) here or go to a specific chapter right away.

1. [安装](https://github.com/uedehua/laravel5-doctrine/wiki/Installation)
2. [ 它是如何工作的](https://github.com/uedehua/laravel5-doctrine/wiki/How-It-Works)
3. [基础](https://github.com/uedehua/laravel5-doctrine/wiki/Basics)
4. [实体管理](https://github.com/uedehua/laravel5-doctrine/wiki/Entity-Manager)
5. [Timestamps Trait](https://github.com/uedehua/laravel5-doctrine/wiki/Timestamps)
6. [SoftDelete Trait](https://github.com/uedehua/laravel5-doctrine/wiki/Soft-Deleting)
7. [Authentication Trait](https://github.com/uedehua/laravel5-doctrine/wiki/Authentication)
8. [Schemas](https://github.com/uedehua/laravel5-doctrine/wiki/Schemas)
9. [Doctrine 配置](https://github.com/uedehua/laravel5-doctrine/wiki/Doctrine-Configuration)
10. [元数据 配置](https://github.com/uedehua/laravel5-doctrine/wiki/Metadata-Configuration)
11. [读取注释](https://github.com/uedehua/laravel5-doctrine/wiki/Annotation-Reader)
12. [元数据](https://github.com/uedehua/laravel5-doctrine/wiki/Metadata)
13. [MIT License](https://github.com/uedehua/laravel5-doctrine/blob/master/LICENSE)

安装
--

[](#安装)

修改项目的 `composer.json` 文件,添加 `uedehua/laravel5-doctrine`

```
"require": {
    "uedehua/laravel5-doctrine": "5.1.*"
}
```

执行composer更新:

```
php composer update
```

添加provider,打开 `app/config/app.php` 配置文件, 在`providers`数组添加一行.

```
'UeDehua\LaravelDoctrine\Provider\DoctrineOrmProvider'
```

添加Facade. 打开 `app/config/app.php` 配置文件, 在`aliases`数组添加一行.

```
'DoctrineOrm' => 'UeDehua\LaravelDoctrine\Facade\DoctrineOrm'
```

别忘记发布你的配置.

```
php artisan config:publish uedehua/laravel5-doctrine --path=vendor/uedehua/laravel5-doctrine/config
```

2 Minutes
---------

[](#2-minutes)

这个包使用 Laravel5 本身的数据库配置, 通过 [Entity Manager](https://github.com/uedehua/laravel5-doctrine/wiki/Entity-Manager) facade (or service locator) 与数据库进行交互. 请参阅 [Doctrine 2](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/index.html) 文档. 下面的小例子展示了如何在它最简单的形式使用Doctrine ORM.

```
