Created
March 9, 2020 12:11
-
-
Save abishekrsrikaanth/260db18d3c46d422536a013262f035d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Workdoneright\GroupByTool; | |
| use Laravel\Nova\ResourceTool; | |
| class GroupByTool extends ResourceTool | |
| { | |
| /** | |
| * Get the displayable name of the resource tool. | |
| * | |
| * @return string | |
| */ | |
| public function name() | |
| { | |
| return 'Group_By_Tool'; | |
| } | |
| /** | |
| * Get the component name for the resource tool. | |
| * | |
| * @return string | |
| */ | |
| public function component() | |
| { | |
| return 'group_by_tool'; | |
| } | |
| public function setTitle($title) | |
| { | |
| $this->withMeta(['title' => $title]); | |
| return $this; | |
| } | |
| public function usingModel(string $model) | |
| { | |
| $this->withMeta(['model' => $model]); | |
| return $this; | |
| } | |
| public function groupBy($columns = []) | |
| { | |
| $this->withMeta(['group_by' => $columns]); | |
| return $this; | |
| } | |
| public function selectColumns($columns = []) | |
| { | |
| $this->withMeta(['select_columns' => $columns]); | |
| return $this; | |
| } | |
| public function usingWhereCondition($data) | |
| { | |
| $this->withMeta(['using_where' => $data]); | |
| return $this; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment