1 <?php namespace Oxbow\Repos;
11 * BookRepo constructor.
14 public function __construct(Book $book)
19 public function getById($id)
21 return $this->book->findOrFail($id);
24 public function getAll()
26 return $this->book->all();
29 public function getBySlug($slug)
31 return $this->book->where('slug', '=', $slug)->first();
34 public function newFromInput($input)
36 return $this->book->fill($input);
39 public function countBySlug($slug)
41 return $this->book->where('slug', '=', $slug)->count();
44 public function destroyById($id)
46 $book = $this->getById($id);