<?php


namespace App\Repositories;


use App\Role;

class RoleRepository implements RepositoryInterface {
    public static function all() {
        return Role::where("slug", "!=", "super_admin")->get();
    }

    public static function create(array $data) {
        return Role::create($data);
    }

    public static function update(array $data, $id) {
        Role::findOrFail($id)->update($data);
        return Role::findOrFail($id);
    }

    public static function delete($id){
        return Role::destroy($id);
    }

    public static function find($id){
        return Role::findOrFail($id);
    }

}
