Skip to content

Commit 4cb76e3

Browse files
committed
Add Get By Key To Blocks
Signed-off-by: David Thorpe <[email protected]>
1 parent 12ab278 commit 4cb76e3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php namespace Davzie\LaravelBootstrap\Blocks;
22

33
interface BlocksInterface {
4-
4+
5+
/**
6+
* Get all the blocks where the key is equal to the item you mention
7+
* @return Eloquent
8+
*/
9+
public function getByKey($key);
10+
511
}

src/Davzie/LaravelBootstrap/Blocks/BlocksRepository.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ public function __construct( Blocks $blocks )
1616
$this->model = $blocks;
1717
}
1818

19+
/**
20+
* Get all the blocks where the key is equal to the item you mention
21+
* @return Eloquent
22+
*/
23+
public function getByKey($key)
24+
{
25+
return $this->model->where('key','=',$key)->first();
26+
}
27+
1928
}

0 commit comments

Comments
 (0)