Skip to content

Instantly share code, notes, and snippets.

@lfbn
Last active July 31, 2020 18:19
Show Gist options
  • Save lfbn/de3e681237c338a2f61b1939b9d4c30a to your computer and use it in GitHub Desktop.
Save lfbn/de3e681237c338a2f61b1939b9d4c30a to your computer and use it in GitHub Desktop.
EloquentRepositoryInterface.php #laravel #laravel_repositories
<?php
namespace App\Repositories\Eloquent;
use Illuminate\Database\Eloquent\Model;
/**
* Interface EloquentRepositoryInterface
* @package App\Repositories\Eloquent
*/
interface EloquentRepositoryInterface
{
/**
* @param array $attributes
* @return Model
*/
public function create(array $attributes): Model;
/**
* @param int $id
* @return Model|null
*/
public function find(int $id): ?Model;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment