update inbox list
This commit is contained in:
41
vendor/prettus/l5-repository/migration-to-2.0.md
vendored
Normal file
41
vendor/prettus/l5-repository/migration-to-2.0.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# Laravel 5 Repositories
|
||||
|
||||
[](https://packagist.org/packages/prettus/l5-repository)
|
||||
|
||||
## Migrate from version 1.0 to 2.0
|
||||
|
||||
### Registering the model's repository
|
||||
|
||||
*Versão 1.0*
|
||||
|
||||
```php
|
||||
use Prettus\Repository\Eloquent\Repository;
|
||||
|
||||
class PostRepository extends Repository {
|
||||
|
||||
public function __construct(Post $model)
|
||||
{
|
||||
parent::__construct($model);
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
*Versão 2.0*
|
||||
|
||||
```php
|
||||
use Prettus\Repository\Eloquent\BaseRepository;
|
||||
|
||||
class PostRepository extends BaseRepository {
|
||||
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
return "App\\Post";
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user