d2d.emegrendeles.hu/resources/extra/stubs/Repository.stub
E98Developer 68b7c35bef git init
2026-02-28 06:53:05 +01:00

53 lines
816 B
Plaintext

<?php
namespace App\Repositories;
use App\Models\{{modelName}};
class {{modelName}}Repository implements {{modelName}}RepositoryInterface
{
/**
* Get's a record by it's ID
*
* @param int
* @return collection
*/
public function get($id)
{
return {{modelName}}::find($id);
}
/**
* Get's all records.
*
* @return mixed
*/
public function all()
{
return {{modelName}}::all();
}
/**
* Deletes a record.
*
* @param int
*/
public function delete($id)
{
{{modelName}}::destroy($id);
}
/**
* Updates a record.
*
* @param int
* @param array
*/
public function update($id, array $data)
{
{{modelName}}::find($id)->update($data);
}
}