Skip to content

Instantly share code, notes, and snippets.

@aungwinthant
Created September 16, 2019 03:07
Show Gist options
  • Save aungwinthant/7bc5ff0478d519d2ab7b108d27198022 to your computer and use it in GitHub Desktop.
Save aungwinthant/7bc5ff0478d519d2ab7b108d27198022 to your computer and use it in GitHub Desktop.
Abstract Class For Repository
<?php
namespace App\Repositories;
abstract class Repository{
public function save(array $data){
return $this->model->create($data);
}
public function update(array $data){
$this->model->update($data);
}
public function list(){
return $this->model->all();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment