<?php

namespace App\Repositories\Eloquent;

use App\Models\RolePermission;
use App\Repositories\Interfaces\RolePermissionRepositoryInterface;
use Illuminate\Support\Collection;

class RolePermissionRepository extends BaseRepository implements RolePermissionRepositoryInterface
{

    /**
    * RolePermissionRepository constructor.
    *
    * @param RolePermission $model
    */
    public function __construct(RolePermission $model)
    {
       parent::__construct($model);
    }

    public function getByRole($id)
    {
        return $this->model->where('role_id', $id)->get();
    }

    public function removePermission($id)
    {
        return $this->model->where('role_id', $id)->delete();
    }

}
