public function deleteBrickBySlug($slug)
    {
        $bricks = $this->repository->bricks;
        foreach ($bricks as $key => $brickObject) {
            if ($brickObject->slug == $slug) {
                unset($bricks[$key]);
            }
        }

        $bricks = array_values($bricks);
        $this->repository->bricks = $bricks;
        $this->save();
    }
public function deleteBrickBySlug($slug)
    {
        $bricks = $this->repository->bricks;
        foreach ($bricks as $key => $brickObject) {
            if ($brickObject->slug == $slug) {
                unset($bricks[$key]);
            }
        }

        $bricks = array_values($bricks);
        $this->repository->bricks = $bricks;
        $this->save();
    }
public function deleteBrickBySlug ( $ slug ) { $ bricks = $ this -> repository -> bricks ; foreach ( $ bricks as $ key => $ brickObject ) { if ( $ brickObject -> slug == $ slug ) { unset ( $ bricks [ $ key ] ) ; } } $ bricks = array_values ( $ bricks ) ; $ this -> repository -> bricks = $ bricks ; $ this -> save ( ) ; }
Delete a brick by its slug

@param $slug

@throws \Exception
Delete a brick by its slug