delete(); } public function create(array $data) { return Template::create($data); } public function update($id, array $newDetails) { return Template::where('id', $id)->update($newDetails); } public function pluck(callable $query = null) { return Template::where(['status' => 11]) ->select('id', 'title', 'alias', 'type') ->get() ->groupBy('type') ->mapWithKeys(function ($templates, $type) { return [ $type => $templates->mapWithKeys(function ($template) { return [$template->id => $template->title]; }), ]; }); } public function where($filter) { return Template::where($filter); } }