id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
220,800
CachetHQ/Cachet
app/Console/Commands/DemoSeederCommand.php
DemoSeederCommand.seedSettings
protected function seedSettings() { $defaultSettings = [ [ 'key' => 'app_name', 'value' => 'Cachet Demo', ], [ 'key' => 'app_domain', 'value' => 'https://demo.cachethq.io', ], [ 'key' =>...
php
protected function seedSettings() { $defaultSettings = [ [ 'key' => 'app_name', 'value' => 'Cachet Demo', ], [ 'key' => 'app_domain', 'value' => 'https://demo.cachethq.io', ], [ 'key' =>...
[ "protected", "function", "seedSettings", "(", ")", "{", "$", "defaultSettings", "=", "[", "[", "'key'", "=>", "'app_name'", ",", "'value'", "=>", "'Cachet Demo'", ",", "]", ",", "[", "'key'", "=>", "'app_domain'", ",", "'value'", "=>", "'https://demo.cachethq....
Seed the settings table. @return void
[ "Seed", "the", "settings", "table", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/DemoSeederCommand.php#L377-L424
220,801
CachetHQ/Cachet
app/Console/Commands/DemoSeederCommand.php
DemoSeederCommand.seedUsers
protected function seedUsers() { $users = [ [ 'username' => 'test', 'password' => 'test123', 'email' => 'test@example.com', 'level' => User::LEVEL_ADMIN, 'api_key' => '9yMHsdioQosnyVK4iCVR', ], ...
php
protected function seedUsers() { $users = [ [ 'username' => 'test', 'password' => 'test123', 'email' => 'test@example.com', 'level' => User::LEVEL_ADMIN, 'api_key' => '9yMHsdioQosnyVK4iCVR', ], ...
[ "protected", "function", "seedUsers", "(", ")", "{", "$", "users", "=", "[", "[", "'username'", "=>", "'test'", ",", "'password'", "=>", "'test123'", ",", "'email'", "=>", "'test@example.com'", ",", "'level'", "=>", "User", "::", "LEVEL_ADMIN", ",", "'api_ke...
Seed the users table. @return void
[ "Seed", "the", "users", "table", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Console/Commands/DemoSeederCommand.php#L441-L458
220,802
CachetHQ/Cachet
app/Bus/Handlers/Commands/ComponentGroup/CreateComponentGroupCommandHandler.php
CreateComponentGroupCommandHandler.handle
public function handle(CreateComponentGroupCommand $command) { $group = ComponentGroup::create([ 'name' => $command->name, 'order' => $command->order, 'collapsed' => $command->collapsed, 'visible' => $command->visible, ]); event(new...
php
public function handle(CreateComponentGroupCommand $command) { $group = ComponentGroup::create([ 'name' => $command->name, 'order' => $command->order, 'collapsed' => $command->collapsed, 'visible' => $command->visible, ]); event(new...
[ "public", "function", "handle", "(", "CreateComponentGroupCommand", "$", "command", ")", "{", "$", "group", "=", "ComponentGroup", "::", "create", "(", "[", "'name'", "=>", "$", "command", "->", "name", ",", "'order'", "=>", "$", "command", "->", "order", ...
Handle the create component group command. @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\CreateComponentGroupCommand $command @return \CachetHQ\Cachet\Models\ComponentGroup
[ "Handle", "the", "create", "component", "group", "command", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/ComponentGroup/CreateComponentGroupCommandHandler.php#L47-L59
220,803
CachetHQ/Cachet
app/Http/Controllers/Api/MetricController.php
MetricController.index
public function index() { $metrics = Metric::query(); if ($sortBy = Binput::get('sort')) { $direction = Binput::has('order') && Binput::get('order') == 'desc'; $metrics->sort($sortBy, $direction); } $metrics = $metrics->paginate(Binput::get('per_page', 20))...
php
public function index() { $metrics = Metric::query(); if ($sortBy = Binput::get('sort')) { $direction = Binput::has('order') && Binput::get('order') == 'desc'; $metrics->sort($sortBy, $direction); } $metrics = $metrics->paginate(Binput::get('per_page', 20))...
[ "public", "function", "index", "(", ")", "{", "$", "metrics", "=", "Metric", "::", "query", "(", ")", ";", "if", "(", "$", "sortBy", "=", "Binput", "::", "get", "(", "'sort'", ")", ")", "{", "$", "direction", "=", "Binput", "::", "has", "(", "'or...
Get all metrics. @return \Illuminate\Database\Eloquent\Collection
[ "Get", "all", "metrics", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/MetricController.php#L30-L43
220,804
CachetHQ/Cachet
app/Http/Controllers/Api/MetricController.php
MetricController.store
public function store() { try { $metric = execute(new CreateMetricCommand( Binput::get('name'), Binput::get('suffix'), Binput::get('description'), Binput::get('default_value'), Binput::get('calc_type', 0), ...
php
public function store() { try { $metric = execute(new CreateMetricCommand( Binput::get('name'), Binput::get('suffix'), Binput::get('description'), Binput::get('default_value'), Binput::get('calc_type', 0), ...
[ "public", "function", "store", "(", ")", "{", "try", "{", "$", "metric", "=", "execute", "(", "new", "CreateMetricCommand", "(", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "::", "get", "(", "'suffix'", ")", ",", "Binput", "::", "get", ...
Create a new metric. @return \Illuminate\Http\JsonResponse
[ "Create", "a", "new", "metric", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/MetricController.php#L62-L83
220,805
CachetHQ/Cachet
app/Http/Controllers/Api/MetricController.php
MetricController.update
public function update(Metric $metric) { try { $metric = execute(new UpdateMetricCommand( $metric, Binput::get('name'), Binput::get('suffix'), Binput::get('description'), Binput::get('default_value'), ...
php
public function update(Metric $metric) { try { $metric = execute(new UpdateMetricCommand( $metric, Binput::get('name'), Binput::get('suffix'), Binput::get('description'), Binput::get('default_value'), ...
[ "public", "function", "update", "(", "Metric", "$", "metric", ")", "{", "try", "{", "$", "metric", "=", "execute", "(", "new", "UpdateMetricCommand", "(", "$", "metric", ",", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "::", "get", "(", ...
Update an existing metric. @param \CachetHQ\Cachet\Models\Metric $metric @return \Illuminate\Http\JsonResponse
[ "Update", "an", "existing", "metric", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/MetricController.php#L92-L114
220,806
CachetHQ/Cachet
app/Repositories/Metric/MySqlRepository.php
MySqlRepository.getPointsSinceMinutes
public function getPointsSinceMinutes(Metric $metric, $minutes) { $queryType = $this->getQueryType($metric); $points = DB::select("SELECT DATE_FORMAT({$this->getMetricPointsTable()}.`created_at`, '%Y-%m-%d %H:%i') AS `key`, {$queryType} ". "FROM {$this->getMetricsTable()} INNER JOIN {$t...
php
public function getPointsSinceMinutes(Metric $metric, $minutes) { $queryType = $this->getQueryType($metric); $points = DB::select("SELECT DATE_FORMAT({$this->getMetricPointsTable()}.`created_at`, '%Y-%m-%d %H:%i') AS `key`, {$queryType} ". "FROM {$this->getMetricsTable()} INNER JOIN {$t...
[ "public", "function", "getPointsSinceMinutes", "(", "Metric", "$", "metric", ",", "$", "minutes", ")", "{", "$", "queryType", "=", "$", "this", "->", "getQueryType", "(", "$", "metric", ")", ";", "$", "points", "=", "DB", "::", "select", "(", "\"SELECT D...
Returns metrics since given minutes. @param \CachetHQ\Cachet\Models\Metric $metric @param int $minutes @return \Illuminate\Support\Collection
[ "Returns", "metrics", "since", "given", "minutes", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Repositories/Metric/MySqlRepository.php#L32-L47
220,807
CachetHQ/Cachet
app/Repositories/Metric/MySqlRepository.php
MySqlRepository.getPointsSinceHour
public function getPointsSinceHour(Metric $metric, $hour) { $queryType = $this->getQueryType($metric); $points = DB::select("SELECT DATE_FORMAT({$this->getMetricPointsTable()}.`created_at`, '%Y-%m-%d %H:00') AS `key`, {$queryType} ". "FROM {$this->getMetricsTable()} INNER JOIN {$this->ge...
php
public function getPointsSinceHour(Metric $metric, $hour) { $queryType = $this->getQueryType($metric); $points = DB::select("SELECT DATE_FORMAT({$this->getMetricPointsTable()}.`created_at`, '%Y-%m-%d %H:00') AS `key`, {$queryType} ". "FROM {$this->getMetricsTable()} INNER JOIN {$this->ge...
[ "public", "function", "getPointsSinceHour", "(", "Metric", "$", "metric", ",", "$", "hour", ")", "{", "$", "queryType", "=", "$", "this", "->", "getQueryType", "(", "$", "metric", ")", ";", "$", "points", "=", "DB", "::", "select", "(", "\"SELECT DATE_FO...
Returns metrics since given hour. @param \CachetHQ\Cachet\Models\Metric $metric @param int $hour @return \Illuminate\Support\Collection
[ "Returns", "metrics", "since", "given", "hour", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Repositories/Metric/MySqlRepository.php#L57-L72
220,808
CachetHQ/Cachet
app/Repositories/Metric/MySqlRepository.php
MySqlRepository.getPointsSinceDay
public function getPointsSinceDay(Metric $metric, $day) { $queryType = $this->getQueryType($metric); $points = DB::select("SELECT DATE_FORMAT({$this->getMetricPointsTable()}.`created_at`, '%Y-%m-%d') AS `key`, {$queryType} ". "FROM {$this->getMetricsTable()} INNER JOIN {$this->getMetricP...
php
public function getPointsSinceDay(Metric $metric, $day) { $queryType = $this->getQueryType($metric); $points = DB::select("SELECT DATE_FORMAT({$this->getMetricPointsTable()}.`created_at`, '%Y-%m-%d') AS `key`, {$queryType} ". "FROM {$this->getMetricsTable()} INNER JOIN {$this->getMetricP...
[ "public", "function", "getPointsSinceDay", "(", "Metric", "$", "metric", ",", "$", "day", ")", "{", "$", "queryType", "=", "$", "this", "->", "getQueryType", "(", "$", "metric", ")", ";", "$", "points", "=", "DB", "::", "select", "(", "\"SELECT DATE_FORM...
Returns metrics since given day. @param \CachetHQ\Cachet\Models\Metric $metric @param int $day @return \Illuminate\Support\Collection
[ "Returns", "metrics", "since", "given", "day", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Repositories/Metric/MySqlRepository.php#L82-L96
220,809
CachetHQ/Cachet
app/Bus/Handlers/Traits/StoresMeta.php
StoresMeta.storeMeta
public function storeMeta($metaData, $metaType, $metaId, $metaModel = Meta::class) { // Validation required instead of type hinting because it could be passed as false or NULL if (!is_array($metaData)) { return; } foreach ($metaData as $key => $value) { $mode...
php
public function storeMeta($metaData, $metaType, $metaId, $metaModel = Meta::class) { // Validation required instead of type hinting because it could be passed as false or NULL if (!is_array($metaData)) { return; } foreach ($metaData as $key => $value) { $mode...
[ "public", "function", "storeMeta", "(", "$", "metaData", ",", "$", "metaType", ",", "$", "metaId", ",", "$", "metaModel", "=", "Meta", "::", "class", ")", "{", "// Validation required instead of type hinting because it could be passed as false or NULL", "if", "(", "!"...
Stores all Meta values of a model. @param array $metaData @param string $metaType @param string|int $metaId @param string $metaModel @return void
[ "Stores", "all", "Meta", "values", "of", "a", "model", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Traits/StoresMeta.php#L28-L57
220,810
CachetHQ/Cachet
app/Bus/Handlers/Traits/StoresMeta.php
StoresMeta.removeEmptyValues
protected function removeEmptyValues($values) { if (!is_array($values)) { return empty($values) ? null : $values; } foreach ($values as $key => $value) { if (!empty($value)) { continue; } unset($values[$key]); } ...
php
protected function removeEmptyValues($values) { if (!is_array($values)) { return empty($values) ? null : $values; } foreach ($values as $key => $value) { if (!empty($value)) { continue; } unset($values[$key]); } ...
[ "protected", "function", "removeEmptyValues", "(", "$", "values", ")", "{", "if", "(", "!", "is_array", "(", "$", "values", ")", ")", "{", "return", "empty", "(", "$", "values", ")", "?", "null", ":", "$", "values", ";", "}", "foreach", "(", "$", "...
Determine if a Value is empty. @param mixed $values @return array|mixed
[ "Determine", "if", "a", "Value", "is", "empty", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Traits/StoresMeta.php#L66-L80
220,811
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ApiController.php
ApiController.postUpdateComponent
public function postUpdateComponent(Component $component) { try { execute(new UpdateComponentCommand( $component, $component->name, $component->description, Binput::get('status'), $component->link, $c...
php
public function postUpdateComponent(Component $component) { try { execute(new UpdateComponentCommand( $component, $component->name, $component->description, Binput::get('status'), $component->link, $c...
[ "public", "function", "postUpdateComponent", "(", "Component", "$", "component", ")", "{", "try", "{", "execute", "(", "new", "UpdateComponentCommand", "(", "$", "component", ",", "$", "component", "->", "name", ",", "$", "component", "->", "description", ",",...
Updates a component with the entered info. @param \CachetHQ\Cachet\Models\Component $component @throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException @return \CachetHQ\Cachet\Models\Component
[ "Updates", "a", "component", "with", "the", "entered", "info", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ApiController.php#L36-L56
220,812
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ApiController.php
ApiController.postUpdateComponentOrder
public function postUpdateComponentOrder() { $componentData = Binput::get('ids'); foreach ($componentData as $order => $componentId) { try { $component = Component::find($componentId); execute(new UpdateComponentCommand( $component, ...
php
public function postUpdateComponentOrder() { $componentData = Binput::get('ids'); foreach ($componentData as $order => $componentId) { try { $component = Component::find($componentId); execute(new UpdateComponentCommand( $component, ...
[ "public", "function", "postUpdateComponentOrder", "(", ")", "{", "$", "componentData", "=", "Binput", "::", "get", "(", "'ids'", ")", ";", "foreach", "(", "$", "componentData", "as", "$", "order", "=>", "$", "componentId", ")", "{", "try", "{", "$", "com...
Updates a components ordering. @return array
[ "Updates", "a", "components", "ordering", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ApiController.php#L63-L89
220,813
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ApiController.php
ApiController.postUpdateComponentGroupOrder
public function postUpdateComponentGroupOrder() { $groupData = Binput::get('ids'); foreach ($groupData as $order => $groupId) { $group = ComponentGroup::find($groupId); execute(new UpdateComponentGroupCommand( $group, $group->name, ...
php
public function postUpdateComponentGroupOrder() { $groupData = Binput::get('ids'); foreach ($groupData as $order => $groupId) { $group = ComponentGroup::find($groupId); execute(new UpdateComponentGroupCommand( $group, $group->name, ...
[ "public", "function", "postUpdateComponentGroupOrder", "(", ")", "{", "$", "groupData", "=", "Binput", "::", "get", "(", "'ids'", ")", ";", "foreach", "(", "$", "groupData", "as", "$", "order", "=>", "$", "groupId", ")", "{", "$", "group", "=", "Componen...
Updates the order of component groups. @return array
[ "Updates", "the", "order", "of", "component", "groups", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ApiController.php#L96-L113
220,814
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ApiController.php
ApiController.getIncidentTemplate
public function getIncidentTemplate() { $templateSlug = Binput::get('slug'); if ($template = IncidentTemplate::where('slug', '=', $templateSlug)->first()) { return $template; } throw new ModelNotFoundException("Incident template for $templateSlug could not be found."); ...
php
public function getIncidentTemplate() { $templateSlug = Binput::get('slug'); if ($template = IncidentTemplate::where('slug', '=', $templateSlug)->first()) { return $template; } throw new ModelNotFoundException("Incident template for $templateSlug could not be found."); ...
[ "public", "function", "getIncidentTemplate", "(", ")", "{", "$", "templateSlug", "=", "Binput", "::", "get", "(", "'slug'", ")", ";", "if", "(", "$", "template", "=", "IncidentTemplate", "::", "where", "(", "'slug'", ",", "'='", ",", "$", "templateSlug", ...
Returns a template by slug. @throws \Illuminate\Database\Eloquent\ModelNotFoundException @return \CachetHQ\Cachet\Models\IncidentTemplate
[ "Returns", "a", "template", "by", "slug", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ApiController.php#L122-L131
220,815
CachetHQ/Cachet
app/Http/Controllers/Api/IncidentController.php
IncidentController.index
public function index() { $incidentVisibility = app(Guard::class)->check() ? 0 : 1; $incidents = Incident::where('visible', '>=', $incidentVisibility); $incidents->search(Binput::except(['sort', 'order', 'per_page'])); if ($sortBy = Binput::get('sort')) { $direction = ...
php
public function index() { $incidentVisibility = app(Guard::class)->check() ? 0 : 1; $incidents = Incident::where('visible', '>=', $incidentVisibility); $incidents->search(Binput::except(['sort', 'order', 'per_page'])); if ($sortBy = Binput::get('sort')) { $direction = ...
[ "public", "function", "index", "(", ")", "{", "$", "incidentVisibility", "=", "app", "(", "Guard", "::", "class", ")", "->", "check", "(", ")", "?", "0", ":", "1", ";", "$", "incidents", "=", "Incident", "::", "where", "(", "'visible'", ",", "'>='", ...
Get all incidents. @return \Illuminate\Http\JsonResponse
[ "Get", "all", "incidents", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/IncidentController.php#L31-L48
220,816
CachetHQ/Cachet
app/Http/Controllers/Api/IncidentController.php
IncidentController.store
public function store() { try { $incident = execute(new CreateIncidentCommand( Binput::get('name'), Binput::get('status'), Binput::get('message', null, false, false), (bool) Binput::get('visible', true), Binput::get(...
php
public function store() { try { $incident = execute(new CreateIncidentCommand( Binput::get('name'), Binput::get('status'), Binput::get('message', null, false, false), (bool) Binput::get('visible', true), Binput::get(...
[ "public", "function", "store", "(", ")", "{", "try", "{", "$", "incident", "=", "execute", "(", "new", "CreateIncidentCommand", "(", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "::", "get", "(", "'status'", ")", ",", "Binput", "::", "get"...
Create a new incident. @return \Illuminate\Http\JsonResponse
[ "Create", "a", "new", "incident", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/IncidentController.php#L67-L89
220,817
CachetHQ/Cachet
app/Http/Controllers/Api/IncidentController.php
IncidentController.update
public function update(Incident $incident) { try { $incident = execute(new UpdateIncidentCommand( $incident, Binput::get('name'), Binput::get('status'), Binput::get('message'), (bool) Binput::get('visible', true), ...
php
public function update(Incident $incident) { try { $incident = execute(new UpdateIncidentCommand( $incident, Binput::get('name'), Binput::get('status'), Binput::get('message'), (bool) Binput::get('visible', true), ...
[ "public", "function", "update", "(", "Incident", "$", "incident", ")", "{", "try", "{", "$", "incident", "=", "execute", "(", "new", "UpdateIncidentCommand", "(", "$", "incident", ",", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "::", "get"...
Update an existing incident. @param \CachetHQ\Cachet\Models\Incident $incident @return \Illuminate\Http\JsonResponse
[ "Update", "an", "existing", "incident", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/IncidentController.php#L98-L120
220,818
CachetHQ/Cachet
app/Bus/Handlers/Jobs/System/SendBeaconJobHandler.php
SendBeaconJobHandler.handle
public function handle(SendBeaconJob $job) { // Don't send anything if the installation explicitly prevents us. if (!$this->beacon->enabled()) { return; } try { $this->beacon->send(); } catch (Exception $e) { // } }
php
public function handle(SendBeaconJob $job) { // Don't send anything if the installation explicitly prevents us. if (!$this->beacon->enabled()) { return; } try { $this->beacon->send(); } catch (Exception $e) { // } }
[ "public", "function", "handle", "(", "SendBeaconJob", "$", "job", ")", "{", "// Don't send anything if the installation explicitly prevents us.", "if", "(", "!", "$", "this", "->", "beacon", "->", "enabled", "(", ")", ")", "{", "return", ";", "}", "try", "{", ...
Handle the send beacon job. @param \CachetHQ\Cachet\Bus\Jobs\System\SendBeaconJob $job @return void
[ "Handle", "the", "send", "beacon", "job", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Jobs/System/SendBeaconJobHandler.php#L51-L63
220,819
CachetHQ/Cachet
app/Bus/Handlers/Commands/ComponentGroup/RemoveComponentGroupCommandHandler.php
RemoveComponentGroupCommandHandler.handle
public function handle(RemoveComponentGroupCommand $command) { $group = $command->group; event(new ComponentGroupWasRemovedEvent($this->auth->user(), $group)); // Remove the group id from all component. $group->components->map(function ($component) { $component->update(...
php
public function handle(RemoveComponentGroupCommand $command) { $group = $command->group; event(new ComponentGroupWasRemovedEvent($this->auth->user(), $group)); // Remove the group id from all component. $group->components->map(function ($component) { $component->update(...
[ "public", "function", "handle", "(", "RemoveComponentGroupCommand", "$", "command", ")", "{", "$", "group", "=", "$", "command", "->", "group", ";", "event", "(", "new", "ComponentGroupWasRemovedEvent", "(", "$", "this", "->", "auth", "->", "user", "(", ")",...
Handle the remove component group command. @param \CachetHQ\Cachet\Bus\Commands\ComponentGroup\RemoveComponentGroupCommand $command @return void
[ "Handle", "the", "remove", "component", "group", "command", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/ComponentGroup/RemoveComponentGroupCommandHandler.php#L46-L58
220,820
CachetHQ/Cachet
app/Bus/Handlers/Commands/Metric/UpdateMetricCommandHandler.php
UpdateMetricCommandHandler.handle
public function handle(UpdateMetricCommand $command) { $metric = $command->metric; $metric->update($this->filter($command)); event(new MetricWasUpdatedEvent($this->auth->user(), $metric)); return $metric; }
php
public function handle(UpdateMetricCommand $command) { $metric = $command->metric; $metric->update($this->filter($command)); event(new MetricWasUpdatedEvent($this->auth->user(), $metric)); return $metric; }
[ "public", "function", "handle", "(", "UpdateMetricCommand", "$", "command", ")", "{", "$", "metric", "=", "$", "command", "->", "metric", ";", "$", "metric", "->", "update", "(", "$", "this", "->", "filter", "(", "$", "command", ")", ")", ";", "event",...
Handle the update metric command. @param \CachetHQ\Cachet\Bus\Commands\Metric\UpdateMetricCommand $command @return \CachetHQ\Cachet\Models\Metric
[ "Handle", "the", "update", "metric", "command", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Metric/UpdateMetricCommandHandler.php#L47-L56
220,821
CachetHQ/Cachet
app/Http/Controllers/Api/GeneralController.php
GeneralController.version
public function version() { $latest = app()->make(Releases::class)->latest(); return $this->setMetaData([ 'on_latest' => version_compare(CACHET_VERSION, $latest['tag_name']) === 1, 'latest' => $latest, ])->item(CACHET_VERSION); }
php
public function version() { $latest = app()->make(Releases::class)->latest(); return $this->setMetaData([ 'on_latest' => version_compare(CACHET_VERSION, $latest['tag_name']) === 1, 'latest' => $latest, ])->item(CACHET_VERSION); }
[ "public", "function", "version", "(", ")", "{", "$", "latest", "=", "app", "(", ")", "->", "make", "(", "Releases", "::", "class", ")", "->", "latest", "(", ")", ";", "return", "$", "this", "->", "setMetaData", "(", "[", "'on_latest'", "=>", "version...
Endpoint to show the Cachet version. @return \Illuminate\Http\JsonResponse
[ "Endpoint", "to", "show", "the", "Cachet", "version", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/GeneralController.php#L39-L47
220,822
CachetHQ/Cachet
app/Http/Controllers/Api/GeneralController.php
GeneralController.status
public function status() { $system = app()->make(System::class)->getStatus(); return $this->item([ 'status' => $system['system_status'], 'message' => $system['system_message'], ]); }
php
public function status() { $system = app()->make(System::class)->getStatus(); return $this->item([ 'status' => $system['system_status'], 'message' => $system['system_message'], ]); }
[ "public", "function", "status", "(", ")", "{", "$", "system", "=", "app", "(", ")", "->", "make", "(", "System", "::", "class", ")", "->", "getStatus", "(", ")", ";", "return", "$", "this", "->", "item", "(", "[", "'status'", "=>", "$", "system", ...
Get the system status message. @return \Illuminate\Http\JsonResponse
[ "Get", "the", "system", "status", "message", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/GeneralController.php#L54-L62
220,823
CachetHQ/Cachet
app/Http/Controllers/AuthController.php
AuthController.postLogin
public function postLogin() { $loginData = Binput::only(['username', 'password', 'remember_me']); // Login with username or email. $loginKey = filter_var($loginData['username'], FILTER_VALIDATE_EMAIL) ? 'email' : 'username'; $loginData[$loginKey] = Arr::pull($loginData, 'username');...
php
public function postLogin() { $loginData = Binput::only(['username', 'password', 'remember_me']); // Login with username or email. $loginKey = filter_var($loginData['username'], FILTER_VALIDATE_EMAIL) ? 'email' : 'username'; $loginData[$loginKey] = Arr::pull($loginData, 'username');...
[ "public", "function", "postLogin", "(", ")", "{", "$", "loginData", "=", "Binput", "::", "only", "(", "[", "'username'", ",", "'password'", ",", "'remember_me'", "]", ")", ";", "// Login with username or email.", "$", "loginKey", "=", "filter_var", "(", "$", ...
Logs the user in. @return \Illuminate\Http\RedirectResponse
[ "Logs", "the", "user", "in", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/AuthController.php#L45-L75
220,824
CachetHQ/Cachet
app/Http/Controllers/AuthController.php
AuthController.postTwoFactor
public function postTwoFactor() { // Check that we have a session. if ($userId = Session::pull('2fa_id')) { $code = str_replace(' ', '', Binput::get('code')); // Maybe a temp login here. Auth::loginUsingId($userId); $user = Auth::user(); ...
php
public function postTwoFactor() { // Check that we have a session. if ($userId = Session::pull('2fa_id')) { $code = str_replace(' ', '', Binput::get('code')); // Maybe a temp login here. Auth::loginUsingId($userId); $user = Auth::user(); ...
[ "public", "function", "postTwoFactor", "(", ")", "{", "// Check that we have a session.", "if", "(", "$", "userId", "=", "Session", "::", "pull", "(", "'2fa_id'", ")", ")", "{", "$", "code", "=", "str_replace", "(", "' '", ",", "''", ",", "Binput", "::", ...
Validates the Two Factor token. This feels very hacky, but we have to juggle authentication and codes. @return \Illuminate\Http\RedirectResponse
[ "Validates", "the", "Two", "Factor", "token", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/AuthController.php#L94-L124
220,825
CachetHQ/Cachet
app/Foundation/Providers/AppServiceProvider.php
AppServiceProvider.registerDateFactory
protected function registerDateFactory() { $this->app->singleton(DateFactory::class, function ($app) { $appTimezone = $app['config']->get('app.timezone'); $cacheTimezone = $app['config']->get('cachet.timezone'); return new DateFactory($appTimezone, $cacheTimezone); ...
php
protected function registerDateFactory() { $this->app->singleton(DateFactory::class, function ($app) { $appTimezone = $app['config']->get('app.timezone'); $cacheTimezone = $app['config']->get('cachet.timezone'); return new DateFactory($appTimezone, $cacheTimezone); ...
[ "protected", "function", "registerDateFactory", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "DateFactory", "::", "class", ",", "function", "(", "$", "app", ")", "{", "$", "appTimezone", "=", "$", "app", "[", "'config'", "]", "->", ...
Register the date factory. @return void
[ "Register", "the", "date", "factory", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/AppServiceProvider.php#L78-L86
220,826
CachetHQ/Cachet
app/Repositories/Metric/MetricRepository.php
MetricRepository.listPointsLastHour
public function listPointsLastHour(Metric $metric) { $dateTime = $this->dates->make(); $pointKey = $dateTime->format('Y-m-d H:i'); $nrOfMinutes = 61; $points = $this->repository->getPointsSinceMinutes($metric, $nrOfMinutes + $metric->threshold)->pluck('value', 'key')->take(-$nrOfMinu...
php
public function listPointsLastHour(Metric $metric) { $dateTime = $this->dates->make(); $pointKey = $dateTime->format('Y-m-d H:i'); $nrOfMinutes = 61; $points = $this->repository->getPointsSinceMinutes($metric, $nrOfMinutes + $metric->threshold)->pluck('value', 'key')->take(-$nrOfMinu...
[ "public", "function", "listPointsLastHour", "(", "Metric", "$", "metric", ")", "{", "$", "dateTime", "=", "$", "this", "->", "dates", "->", "make", "(", ")", ";", "$", "pointKey", "=", "$", "dateTime", "->", "format", "(", "'Y-m-d H:i'", ")", ";", "$",...
Returns all points as an array, for the last hour. @param \CachetHQ\Cachet\Models\Metric $metric @return \Illuminate\Support\Collection
[ "Returns", "all", "points", "as", "an", "array", "for", "the", "last", "hour", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Repositories/Metric/MetricRepository.php#L60-L85
220,827
CachetHQ/Cachet
app/Repositories/Metric/MetricRepository.php
MetricRepository.listPointsToday
public function listPointsToday(Metric $metric, $hours = 12) { $dateTime = $this->dates->make(); $pointKey = $dateTime->format('Y-m-d H:00'); $points = $this->repository->getPointsSinceHour($metric, $hours)->pluck('value', 'key'); for ($i = 0; $i < $hours; $i++) { if (!$...
php
public function listPointsToday(Metric $metric, $hours = 12) { $dateTime = $this->dates->make(); $pointKey = $dateTime->format('Y-m-d H:00'); $points = $this->repository->getPointsSinceHour($metric, $hours)->pluck('value', 'key'); for ($i = 0; $i < $hours; $i++) { if (!$...
[ "public", "function", "listPointsToday", "(", "Metric", "$", "metric", ",", "$", "hours", "=", "12", ")", "{", "$", "dateTime", "=", "$", "this", "->", "dates", "->", "make", "(", ")", ";", "$", "pointKey", "=", "$", "dateTime", "->", "format", "(", ...
Returns all points as an array, by x hours. @param \CachetHQ\Cachet\Models\Metric $metric @param int $hours @return array
[ "Returns", "all", "points", "as", "an", "array", "by", "x", "hours", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Repositories/Metric/MetricRepository.php#L95-L112
220,828
CachetHQ/Cachet
app/Http/Middleware/Throttler.php
Throttler.getHeaders
protected function getHeaders(string $key, int $limit, int $after = null, array $merge = []) { $remaining = $after === null ? $this->limiter->retriesLeft($key, $limit) : 0; $headers = ['X-RateLimit-Limit' => $limit, 'X-RateLimit-Remaining' => $remaining]; return array_merge($headers, $merge...
php
protected function getHeaders(string $key, int $limit, int $after = null, array $merge = []) { $remaining = $after === null ? $this->limiter->retriesLeft($key, $limit) : 0; $headers = ['X-RateLimit-Limit' => $limit, 'X-RateLimit-Remaining' => $remaining]; return array_merge($headers, $merge...
[ "protected", "function", "getHeaders", "(", "string", "$", "key", ",", "int", "$", "limit", ",", "int", "$", "after", "=", "null", ",", "array", "$", "merge", "=", "[", "]", ")", "{", "$", "remaining", "=", "$", "after", "===", "null", "?", "$", ...
Get the limit header information. @param string $key @param int $limit @param int|null $after @param array $merge @return array
[ "Get", "the", "limit", "header", "information", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Middleware/Throttler.php#L118-L124
220,829
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ComponentGroupController.php
ComponentGroupController.showComponentGroups
public function showComponentGroups() { $this->subMenu['groups']['active'] = true; return View::make('dashboard.components.groups.index') ->withPageTitle(trans_choice('dashboard.components.groups.groups', 2).' - '.trans('dashboard.dashboard')) ->withGroups(ComponentGroup::or...
php
public function showComponentGroups() { $this->subMenu['groups']['active'] = true; return View::make('dashboard.components.groups.index') ->withPageTitle(trans_choice('dashboard.components.groups.groups', 2).' - '.trans('dashboard.dashboard')) ->withGroups(ComponentGroup::or...
[ "public", "function", "showComponentGroups", "(", ")", "{", "$", "this", "->", "subMenu", "[", "'groups'", "]", "[", "'active'", "]", "=", "true", ";", "return", "View", "::", "make", "(", "'dashboard.components.groups.index'", ")", "->", "withPageTitle", "(",...
Shows the component groups view. @return \Illuminate\View\View
[ "Shows", "the", "component", "groups", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ComponentGroupController.php#L71-L79
220,830
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ComponentGroupController.php
ComponentGroupController.deleteComponentGroupAction
public function deleteComponentGroupAction(ComponentGroup $group) { execute(new RemoveComponentGroupCommand($group)); return cachet_redirect('dashboard.components.groups') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success...
php
public function deleteComponentGroupAction(ComponentGroup $group) { execute(new RemoveComponentGroupCommand($group)); return cachet_redirect('dashboard.components.groups') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success...
[ "public", "function", "deleteComponentGroupAction", "(", "ComponentGroup", "$", "group", ")", "{", "execute", "(", "new", "RemoveComponentGroupCommand", "(", "$", "group", ")", ")", ";", "return", "cachet_redirect", "(", "'dashboard.components.groups'", ")", "->", "...
Deletes a given component group. @param \CachetHQ\Cachet\Models\ComponentGroup $group @return \Illuminate\Http\RedirectResponse
[ "Deletes", "a", "given", "component", "group", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ComponentGroupController.php#L88-L94
220,831
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ComponentGroupController.php
ComponentGroupController.showEditComponentGroup
public function showEditComponentGroup(ComponentGroup $group) { return View::make('dashboard.components.groups.edit') ->withPageTitle(trans('dashboard.components.groups.edit.title').' - '.trans('dashboard.dashboard')) ->withGroup($group); }
php
public function showEditComponentGroup(ComponentGroup $group) { return View::make('dashboard.components.groups.edit') ->withPageTitle(trans('dashboard.components.groups.edit.title').' - '.trans('dashboard.dashboard')) ->withGroup($group); }
[ "public", "function", "showEditComponentGroup", "(", "ComponentGroup", "$", "group", ")", "{", "return", "View", "::", "make", "(", "'dashboard.components.groups.edit'", ")", "->", "withPageTitle", "(", "trans", "(", "'dashboard.components.groups.edit.title'", ")", ".",...
Shows the edit component group view. @param \CachetHQ\Cachet\Models\ComponentGroup $group @return \Illuminate\View\View
[ "Shows", "the", "edit", "component", "group", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ComponentGroupController.php#L114-L119
220,832
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ComponentGroupController.php
ComponentGroupController.updateComponentGroupAction
public function updateComponentGroupAction(ComponentGroup $group) { try { $group = execute(new UpdateComponentGroupCommand( $group, Binput::get('name'), $group->order, Binput::get('collapsed'), Binput::get('visible')...
php
public function updateComponentGroupAction(ComponentGroup $group) { try { $group = execute(new UpdateComponentGroupCommand( $group, Binput::get('name'), $group->order, Binput::get('collapsed'), Binput::get('visible')...
[ "public", "function", "updateComponentGroupAction", "(", "ComponentGroup", "$", "group", ")", "{", "try", "{", "$", "group", "=", "execute", "(", "new", "UpdateComponentGroupCommand", "(", "$", "group", ",", "Binput", "::", "get", "(", "'name'", ")", ",", "$...
Updates a component group. @param \CachetHQ\Cachet\Models\ComponentGroup $group @return \Illuminate\Http\RedirectResponse
[ "Updates", "a", "component", "group", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ComponentGroupController.php#L153-L172
220,833
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.showIncidents
public function showIncidents() { $incidents = Incident::with('user')->orderBy('created_at', 'desc')->get(); return View::make('dashboard.incidents.index') ->withPageTitle(trans('dashboard.incidents.incidents').' - '.trans('dashboard.dashboard')) ->withIncidents($incidents);...
php
public function showIncidents() { $incidents = Incident::with('user')->orderBy('created_at', 'desc')->get(); return View::make('dashboard.incidents.index') ->withPageTitle(trans('dashboard.incidents.incidents').' - '.trans('dashboard.dashboard')) ->withIncidents($incidents);...
[ "public", "function", "showIncidents", "(", ")", "{", "$", "incidents", "=", "Incident", "::", "with", "(", "'user'", ")", "->", "orderBy", "(", "'created_at'", ",", "'desc'", ")", "->", "get", "(", ")", ";", "return", "View", "::", "make", "(", "'dash...
Shows the incidents view. @return \Illuminate\View\View
[ "Shows", "the", "incidents", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L76-L83
220,834
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.showAddIncident
public function showAddIncident() { return View::make('dashboard.incidents.add') ->withPageTitle(trans('dashboard.incidents.add.title').' - '.trans('dashboard.dashboard')) ->withComponentsInGroups(ComponentGroup::with('components')->get()) ->withComponentsOutGroups(Compon...
php
public function showAddIncident() { return View::make('dashboard.incidents.add') ->withPageTitle(trans('dashboard.incidents.add.title').' - '.trans('dashboard.dashboard')) ->withComponentsInGroups(ComponentGroup::with('components')->get()) ->withComponentsOutGroups(Compon...
[ "public", "function", "showAddIncident", "(", ")", "{", "return", "View", "::", "make", "(", "'dashboard.incidents.add'", ")", "->", "withPageTitle", "(", "trans", "(", "'dashboard.incidents.add.title'", ")", ".", "' - '", ".", "trans", "(", "'dashboard.dashboard'",...
Shows the add incident view. @return \Illuminate\View\View
[ "Shows", "the", "add", "incident", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L90-L98
220,835
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.createIncidentAction
public function createIncidentAction() { try { $incident = execute(new CreateIncidentCommand( Binput::get('name'), Binput::get('status'), Binput::get('message', null, false, false), Binput::get('visible', true), Binp...
php
public function createIncidentAction() { try { $incident = execute(new CreateIncidentCommand( Binput::get('name'), Binput::get('status'), Binput::get('message', null, false, false), Binput::get('visible', true), Binp...
[ "public", "function", "createIncidentAction", "(", ")", "{", "try", "{", "$", "incident", "=", "execute", "(", "new", "CreateIncidentCommand", "(", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "::", "get", "(", "'status'", ")", ",", "Binput", ...
Creates a new incident. @return \Illuminate\Http\RedirectResponse
[ "Creates", "a", "new", "incident", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L117-L143
220,836
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.showEditTemplateAction
public function showEditTemplateAction(IncidentTemplate $template) { return View::make('dashboard.templates.edit') ->withPageTitle(trans('dashboard.incidents.templates.edit.title').' - '.trans('dashboard.dashboard')) ->withTemplate($template); }
php
public function showEditTemplateAction(IncidentTemplate $template) { return View::make('dashboard.templates.edit') ->withPageTitle(trans('dashboard.incidents.templates.edit.title').' - '.trans('dashboard.dashboard')) ->withTemplate($template); }
[ "public", "function", "showEditTemplateAction", "(", "IncidentTemplate", "$", "template", ")", "{", "return", "View", "::", "make", "(", "'dashboard.templates.edit'", ")", "->", "withPageTitle", "(", "trans", "(", "'dashboard.incidents.templates.edit.title'", ")", ".", ...
Shows the edit incident template view. @param \CachetHQ\Cachet\Models\IncidentTemplate $template @return \Illuminate\View\View
[ "Shows", "the", "edit", "incident", "template", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L163-L168
220,837
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.deleteTemplateAction
public function deleteTemplateAction(IncidentTemplate $template) { $template->delete(); return cachet_redirect('dashboard.templates') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.delete.success'))); }
php
public function deleteTemplateAction(IncidentTemplate $template) { $template->delete(); return cachet_redirect('dashboard.templates') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.delete.success'))); }
[ "public", "function", "deleteTemplateAction", "(", "IncidentTemplate", "$", "template", ")", "{", "$", "template", "->", "delete", "(", ")", ";", "return", "cachet_redirect", "(", "'dashboard.templates'", ")", "->", "withSuccess", "(", "sprintf", "(", "'%s %s'", ...
Deletes an incident template. @param \CachetHQ\Cachet\Models\IncidentTemplate $template @return \Illuminate\Http\RedirectResponse
[ "Deletes", "an", "incident", "template", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L177-L183
220,838
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.createIncidentTemplateAction
public function createIncidentTemplateAction() { try { IncidentTemplate::create([ 'name' => Binput::get('name'), 'template' => Binput::get('template', null, false, false), ]); } catch (ValidationException $e) { return cachet_red...
php
public function createIncidentTemplateAction() { try { IncidentTemplate::create([ 'name' => Binput::get('name'), 'template' => Binput::get('template', null, false, false), ]); } catch (ValidationException $e) { return cachet_red...
[ "public", "function", "createIncidentTemplateAction", "(", ")", "{", "try", "{", "IncidentTemplate", "::", "create", "(", "[", "'name'", "=>", "Binput", "::", "get", "(", "'name'", ")", ",", "'template'", "=>", "Binput", "::", "get", "(", "'template'", ",", ...
Creates a new incident template. @return \Illuminate\Http\RedirectResponse
[ "Creates", "a", "new", "incident", "template", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L190-L206
220,839
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.deleteIncidentAction
public function deleteIncidentAction(Incident $incident) { execute(new RemoveIncidentCommand($incident)); return cachet_redirect('dashboard.incidents') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success'))); }
php
public function deleteIncidentAction(Incident $incident) { execute(new RemoveIncidentCommand($incident)); return cachet_redirect('dashboard.incidents') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success'))); }
[ "public", "function", "deleteIncidentAction", "(", "Incident", "$", "incident", ")", "{", "execute", "(", "new", "RemoveIncidentCommand", "(", "$", "incident", ")", ")", ";", "return", "cachet_redirect", "(", "'dashboard.incidents'", ")", "->", "withSuccess", "(",...
Deletes a given incident. @param \CachetHQ\Cachet\Models\Incident $incident @return \Illuminate\Http\RedirectResponse
[ "Deletes", "a", "given", "incident", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L215-L221
220,840
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.editIncidentAction
public function editIncidentAction(Incident $incident) { try { $incident = execute(new UpdateIncidentCommand( $incident, Binput::get('name'), Binput::get('status'), Binput::get('message'), Binput::get('visible', true...
php
public function editIncidentAction(Incident $incident) { try { $incident = execute(new UpdateIncidentCommand( $incident, Binput::get('name'), Binput::get('status'), Binput::get('message'), Binput::get('visible', true...
[ "public", "function", "editIncidentAction", "(", "Incident", "$", "incident", ")", "{", "try", "{", "$", "incident", "=", "execute", "(", "new", "UpdateIncidentCommand", "(", "$", "incident", ",", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "...
Edit an incident. @param \CachetHQ\Cachet\Models\Incident $incident @return \Illuminate\Http\RedirectResponse
[ "Edit", "an", "incident", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L247-L278
220,841
CachetHQ/Cachet
app/Http/Controllers/Dashboard/IncidentController.php
IncidentController.editTemplateAction
public function editTemplateAction(IncidentTemplate $template) { try { $template->update(Binput::get('template')); } catch (ValidationException $e) { return cachet_redirect('dashboard.templates.edit', ['id' => $template->id]) ->withUpdatedTemplate($template) ...
php
public function editTemplateAction(IncidentTemplate $template) { try { $template->update(Binput::get('template')); } catch (ValidationException $e) { return cachet_redirect('dashboard.templates.edit', ['id' => $template->id]) ->withUpdatedTemplate($template) ...
[ "public", "function", "editTemplateAction", "(", "IncidentTemplate", "$", "template", ")", "{", "try", "{", "$", "template", "->", "update", "(", "Binput", "::", "get", "(", "'template'", ")", ")", ";", "}", "catch", "(", "ValidationException", "$", "e", "...
Edit an incident template. @param \CachetHQ\Cachet\Models\IncidentTemplate $template @return \Illuminate\Http\RedirectResponse
[ "Edit", "an", "incident", "template", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/IncidentController.php#L287-L299
220,842
CachetHQ/Cachet
app/Http/Controllers/Dashboard/SettingsController.php
SettingsController.showSetupView
public function showSetupView() { $this->subMenu['setup']['active'] = true; Session::flash('redirect_to', $this->subMenu['setup']['url']); return View::make('dashboard.settings.app-setup') ->withPageTitle(trans('dashboard.settings.app-setup.app-setup').' - '.trans('dashboard.da...
php
public function showSetupView() { $this->subMenu['setup']['active'] = true; Session::flash('redirect_to', $this->subMenu['setup']['url']); return View::make('dashboard.settings.app-setup') ->withPageTitle(trans('dashboard.settings.app-setup.app-setup').' - '.trans('dashboard.da...
[ "public", "function", "showSetupView", "(", ")", "{", "$", "this", "->", "subMenu", "[", "'setup'", "]", "[", "'active'", "]", "=", "true", ";", "Session", "::", "flash", "(", "'redirect_to'", ",", "$", "this", "->", "subMenu", "[", "'setup'", "]", "["...
Shows the settings setup view. @return \Illuminate\View\View
[ "Shows", "the", "settings", "setup", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SettingsController.php#L129-L139
220,843
CachetHQ/Cachet
app/Http/Controllers/Dashboard/SettingsController.php
SettingsController.showSecurityView
public function showSecurityView() { $this->subMenu['security']['active'] = true; $unsecureUsers = User::whereNull('google_2fa_secret')->orWhere('google_2fa_secret', '=', '')->get(); Session::flash('redirect_to', $this->subMenu['security']['url']); return View::make('dashboard.set...
php
public function showSecurityView() { $this->subMenu['security']['active'] = true; $unsecureUsers = User::whereNull('google_2fa_secret')->orWhere('google_2fa_secret', '=', '')->get(); Session::flash('redirect_to', $this->subMenu['security']['url']); return View::make('dashboard.set...
[ "public", "function", "showSecurityView", "(", ")", "{", "$", "this", "->", "subMenu", "[", "'security'", "]", "[", "'active'", "]", "=", "true", ";", "$", "unsecureUsers", "=", "User", "::", "whereNull", "(", "'google_2fa_secret'", ")", "->", "orWhere", "...
Shows the settings security view. @return \Illuminate\View\View
[ "Shows", "the", "settings", "security", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SettingsController.php#L210-L222
220,844
CachetHQ/Cachet
app/Http/Controllers/Dashboard/SettingsController.php
SettingsController.showStylesheetView
public function showStylesheetView() { $this->subMenu['stylesheet']['active'] = true; Session::flash('redirect_to', $this->subMenu['stylesheet']['url']); return View::make('dashboard.settings.stylesheet') ->withPageTitle(trans('dashboard.settings.stylesheet.stylesheet').' - '.t...
php
public function showStylesheetView() { $this->subMenu['stylesheet']['active'] = true; Session::flash('redirect_to', $this->subMenu['stylesheet']['url']); return View::make('dashboard.settings.stylesheet') ->withPageTitle(trans('dashboard.settings.stylesheet.stylesheet').' - '.t...
[ "public", "function", "showStylesheetView", "(", ")", "{", "$", "this", "->", "subMenu", "[", "'stylesheet'", "]", "[", "'active'", "]", "=", "true", ";", "Session", "::", "flash", "(", "'redirect_to'", ",", "$", "this", "->", "subMenu", "[", "'stylesheet'...
Shows the settings stylesheet view. @return \Illuminate\View\View
[ "Shows", "the", "settings", "stylesheet", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SettingsController.php#L229-L238
220,845
CachetHQ/Cachet
app/Http/Controllers/Dashboard/SettingsController.php
SettingsController.showCreditsView
public function showCreditsView() { $this->subMenu['credits']['active'] = true; $credits = app(Credits::class)->latest(); $backers = $credits['backers']; $contributors = $credits['contributors']; shuffle($backers); shuffle($contributors); return View::make...
php
public function showCreditsView() { $this->subMenu['credits']['active'] = true; $credits = app(Credits::class)->latest(); $backers = $credits['backers']; $contributors = $credits['contributors']; shuffle($backers); shuffle($contributors); return View::make...
[ "public", "function", "showCreditsView", "(", ")", "{", "$", "this", "->", "subMenu", "[", "'credits'", "]", "[", "'active'", "]", "=", "true", ";", "$", "credits", "=", "app", "(", "Credits", "::", "class", ")", "->", "latest", "(", ")", ";", "$", ...
Show the credits view. @return \Illuminate\View\View
[ "Show", "the", "credits", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SettingsController.php#L245-L262
220,846
CachetHQ/Cachet
app/Http/Controllers/Dashboard/SettingsController.php
SettingsController.showLogView
public function showLogView() { $this->subMenu['log']['active'] = true; $log = Log::getLogger(); $logContents = ''; collect($log->getHandlers())->reject(function ($handler) { return $handler instanceof SyslogHandler; })->each(function ($handler) use (&$logConte...
php
public function showLogView() { $this->subMenu['log']['active'] = true; $log = Log::getLogger(); $logContents = ''; collect($log->getHandlers())->reject(function ($handler) { return $handler instanceof SyslogHandler; })->each(function ($handler) use (&$logConte...
[ "public", "function", "showLogView", "(", ")", "{", "$", "this", "->", "subMenu", "[", "'log'", "]", "[", "'active'", "]", "=", "true", ";", "$", "log", "=", "Log", "::", "getLogger", "(", ")", ";", "$", "logContents", "=", "''", ";", "collect", "(...
Show the most recent log. @return \Illuminate\View\View
[ "Show", "the", "most", "recent", "log", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SettingsController.php#L269-L286
220,847
CachetHQ/Cachet
app/Http/Controllers/Dashboard/SettingsController.php
SettingsController.postMail
public function postMail() { $config = Binput::get('config'); execute(new UpdateConfigCommand($config)); return cachet_redirect('dashboard.settings.mail') ->withInput(Binput::all()) ->withSuccess(trans('dashboard.notifications.awesome')); }
php
public function postMail() { $config = Binput::get('config'); execute(new UpdateConfigCommand($config)); return cachet_redirect('dashboard.settings.mail') ->withInput(Binput::all()) ->withSuccess(trans('dashboard.notifications.awesome')); }
[ "public", "function", "postMail", "(", ")", "{", "$", "config", "=", "Binput", "::", "get", "(", "'config'", ")", ";", "execute", "(", "new", "UpdateConfigCommand", "(", "$", "config", ")", ")", ";", "return", "cachet_redirect", "(", "'dashboard.settings.mai...
Handle updating of the settings. @return \Illuminate\Http\RedirectResponse
[ "Handle", "updating", "of", "the", "settings", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SettingsController.php#L318-L327
220,848
CachetHQ/Cachet
app/Http/Controllers/Dashboard/SettingsController.php
SettingsController.postSettings
public function postSettings() { $setting = app(Repository::class); if (Binput::get('remove_banner') === '1') { $setting->set('app_banner', null); } $parameters = Binput::all(); if (isset($parameters['header'])) { if ($header = Binput::get('header',...
php
public function postSettings() { $setting = app(Repository::class); if (Binput::get('remove_banner') === '1') { $setting->set('app_banner', null); } $parameters = Binput::all(); if (isset($parameters['header'])) { if ($header = Binput::get('header',...
[ "public", "function", "postSettings", "(", ")", "{", "$", "setting", "=", "app", "(", "Repository", "::", "class", ")", ";", "if", "(", "Binput", "::", "get", "(", "'remove_banner'", ")", "===", "'1'", ")", "{", "$", "setting", "->", "set", "(", "'ap...
Updates the status page settings. @return \Illuminate\View\View
[ "Updates", "the", "status", "page", "settings", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SettingsController.php#L334-L402
220,849
CachetHQ/Cachet
app/Http/Controllers/Dashboard/SettingsController.php
SettingsController.handleUpdateBanner
protected function handleUpdateBanner(Repository $setting) { $file = Binput::file('app_banner'); $redirectUrl = $this->subMenu['theme']['url']; // Image Validation. // Image size in bytes. $maxSize = $file->getMaxFilesize(); if ($file->getSize() > $maxSize) { ...
php
protected function handleUpdateBanner(Repository $setting) { $file = Binput::file('app_banner'); $redirectUrl = $this->subMenu['theme']['url']; // Image Validation. // Image size in bytes. $maxSize = $file->getMaxFilesize(); if ($file->getSize() > $maxSize) { ...
[ "protected", "function", "handleUpdateBanner", "(", "Repository", "$", "setting", ")", "{", "$", "file", "=", "Binput", "::", "file", "(", "'app_banner'", ")", ";", "$", "redirectUrl", "=", "$", "this", "->", "subMenu", "[", "'theme'", "]", "[", "'url'", ...
Handle updating of the banner image. @param \CachetHQ\Cachet\Settings\Repository $setting @return void
[ "Handle", "updating", "of", "the", "banner", "image", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/SettingsController.php#L411-L437
220,850
CachetHQ/Cachet
app/Bus/Handlers/Commands/Incident/CreateIncidentCommandHandler.php
CreateIncidentCommandHandler.handle
public function handle(CreateIncidentCommand $command) { $data = [ 'user_id' => $this->auth->user()->id, 'name' => $command->name, 'status' => $command->status, 'visible' => $command->visible, 'stickied' => $command->stickied, ]; ...
php
public function handle(CreateIncidentCommand $command) { $data = [ 'user_id' => $this->auth->user()->id, 'name' => $command->name, 'status' => $command->status, 'visible' => $command->visible, 'stickied' => $command->stickied, ]; ...
[ "public", "function", "handle", "(", "CreateIncidentCommand", "$", "command", ")", "{", "$", "data", "=", "[", "'user_id'", "=>", "$", "this", "->", "auth", "->", "user", "(", ")", "->", "id", ",", "'name'", "=>", "$", "command", "->", "name", ",", "...
Handle the create incident command. @param \CachetHQ\Cachet\Bus\Commands\Incident\CreateIncidentCommand $command @return \CachetHQ\Cachet\Models\Incident
[ "Handle", "the", "create", "incident", "command", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Incident/CreateIncidentCommandHandler.php#L73-L132
220,851
CachetHQ/Cachet
app/Http/Controllers/Dashboard/MetricController.php
MetricController.showMetrics
public function showMetrics() { $metrics = Metric::orderBy('order')->orderBy('id')->get(); return View::make('dashboard.metrics.index') ->withPageTitle(trans('dashboard.metrics.metrics').' - '.trans('dashboard.dashboard')) ->withMetrics($metrics); }
php
public function showMetrics() { $metrics = Metric::orderBy('order')->orderBy('id')->get(); return View::make('dashboard.metrics.index') ->withPageTitle(trans('dashboard.metrics.metrics').' - '.trans('dashboard.dashboard')) ->withMetrics($metrics); }
[ "public", "function", "showMetrics", "(", ")", "{", "$", "metrics", "=", "Metric", "::", "orderBy", "(", "'order'", ")", "->", "orderBy", "(", "'id'", ")", "->", "get", "(", ")", ";", "return", "View", "::", "make", "(", "'dashboard.metrics.index'", ")",...
Shows the metrics view. @return \Illuminate\View\View
[ "Shows", "the", "metrics", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/MetricController.php#L31-L38
220,852
CachetHQ/Cachet
app/Http/Controllers/Dashboard/MetricController.php
MetricController.createMetricAction
public function createMetricAction() { $metricData = Binput::get('metric'); try { execute(new CreateMetricCommand( $metricData['name'], $metricData['suffix'], $metricData['description'], $metricData['default_value'], ...
php
public function createMetricAction() { $metricData = Binput::get('metric'); try { execute(new CreateMetricCommand( $metricData['name'], $metricData['suffix'], $metricData['description'], $metricData['default_value'], ...
[ "public", "function", "createMetricAction", "(", ")", "{", "$", "metricData", "=", "Binput", "::", "get", "(", "'metric'", ")", ";", "try", "{", "execute", "(", "new", "CreateMetricCommand", "(", "$", "metricData", "[", "'name'", "]", ",", "$", "metricData...
Creates a new metric. @return \Illuminate\Http\RedirectResponse
[ "Creates", "a", "new", "metric", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/MetricController.php#L69-L96
220,853
CachetHQ/Cachet
app/Http/Controllers/Dashboard/MetricController.php
MetricController.deleteMetricAction
public function deleteMetricAction(Metric $metric) { execute(new RemoveMetricCommand($metric)); return cachet_redirect('dashboard.metrics') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success'))); }
php
public function deleteMetricAction(Metric $metric) { execute(new RemoveMetricCommand($metric)); return cachet_redirect('dashboard.metrics') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success'))); }
[ "public", "function", "deleteMetricAction", "(", "Metric", "$", "metric", ")", "{", "execute", "(", "new", "RemoveMetricCommand", "(", "$", "metric", ")", ")", ";", "return", "cachet_redirect", "(", "'dashboard.metrics'", ")", "->", "withSuccess", "(", "sprintf"...
Deletes a given metric. @param \CachetHQ\Cachet\Models\Metric $metric @return \Illuminate\Http\RedirectResponse
[ "Deletes", "a", "given", "metric", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/MetricController.php#L116-L122
220,854
CachetHQ/Cachet
app/Http/Controllers/Dashboard/MetricController.php
MetricController.showEditMetricAction
public function showEditMetricAction(Metric $metric) { return View::make('dashboard.metrics.edit') ->withPageTitle(trans('dashboard.metrics.edit.title').' - '.trans('dashboard.dashboard')) ->withMetric($metric) ->withAcceptableThresholds(Metric::ACCEPTABLE_THRESHOLDS); ...
php
public function showEditMetricAction(Metric $metric) { return View::make('dashboard.metrics.edit') ->withPageTitle(trans('dashboard.metrics.edit.title').' - '.trans('dashboard.dashboard')) ->withMetric($metric) ->withAcceptableThresholds(Metric::ACCEPTABLE_THRESHOLDS); ...
[ "public", "function", "showEditMetricAction", "(", "Metric", "$", "metric", ")", "{", "return", "View", "::", "make", "(", "'dashboard.metrics.edit'", ")", "->", "withPageTitle", "(", "trans", "(", "'dashboard.metrics.edit.title'", ")", ".", "' - '", ".", "trans",...
Shows the edit metric view. @param \CachetHQ\Cachet\Models\Metric $metric @return \Illuminate\View\View
[ "Shows", "the", "edit", "metric", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/MetricController.php#L131-L137
220,855
CachetHQ/Cachet
app/Http/Controllers/Dashboard/MetricController.php
MetricController.editMetricAction
public function editMetricAction(Metric $metric) { try { execute(new UpdateMetricCommand( $metric, Binput::get('name', null, false), Binput::get('suffix', null, false), Binput::get('description', null, false), Binput...
php
public function editMetricAction(Metric $metric) { try { execute(new UpdateMetricCommand( $metric, Binput::get('name', null, false), Binput::get('suffix', null, false), Binput::get('description', null, false), Binput...
[ "public", "function", "editMetricAction", "(", "Metric", "$", "metric", ")", "{", "try", "{", "execute", "(", "new", "UpdateMetricCommand", "(", "$", "metric", ",", "Binput", "::", "get", "(", "'name'", ",", "null", ",", "false", ")", ",", "Binput", "::"...
Edit an metric. @param \CachetHQ\Cachet\Models\Metric $metric @return \Illuminate\Http\RedirectResponse
[ "Edit", "an", "metric", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/MetricController.php#L146-L172
220,856
CachetHQ/Cachet
app/Models/Traits/SortableTrait.php
SortableTrait.scopeSort
public function scopeSort(Builder $query, $column, $direction) { if (!in_array($column, $this->sortable)) { return $query; } return $query->orderBy($column, $direction); }
php
public function scopeSort(Builder $query, $column, $direction) { if (!in_array($column, $this->sortable)) { return $query; } return $query->orderBy($column, $direction); }
[ "public", "function", "scopeSort", "(", "Builder", "$", "query", ",", "$", "column", ",", "$", "direction", ")", "{", "if", "(", "!", "in_array", "(", "$", "column", ",", "$", "this", "->", "sortable", ")", ")", "{", "return", "$", "query", ";", "}...
Adds a sort scope. @param \Illuminate\Database\Eloquent\Builder $query @param string $column @param string $direction @return \Illuminate\Database\Eloquent\Builder
[ "Adds", "a", "sort", "scope", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/Traits/SortableTrait.php#L32-L39
220,857
CachetHQ/Cachet
app/Settings/Repository.php
Repository.all
public function all() { try { return $this->model->all(['name', 'value'])->pluck('value', 'name')->map(function ($value, $name) { return $this->castSetting($name, $value); })->toArray(); } catch (Exception $e) { throw new ReadException($e); ...
php
public function all() { try { return $this->model->all(['name', 'value'])->pluck('value', 'name')->map(function ($value, $name) { return $this->castSetting($name, $value); })->toArray(); } catch (Exception $e) { throw new ReadException($e); ...
[ "public", "function", "all", "(", ")", "{", "try", "{", "return", "$", "this", "->", "model", "->", "all", "(", "[", "'name'", ",", "'value'", "]", ")", "->", "pluck", "(", "'value'", ",", "'name'", ")", "->", "map", "(", "function", "(", "$", "v...
Returns a setting from the database. @throws \CachetHQ\Cachet\Settings\ReadException @return array
[ "Returns", "a", "setting", "from", "the", "database", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Settings/Repository.php#L67-L76
220,858
CachetHQ/Cachet
app/Settings/Repository.php
Repository.set
public function set($name, $value) { $this->stale = true; try { if ($value === null) { $this->model->where('name', '=', $name)->delete(); } else { $this->model->updateOrCreate(compact('name'), compact('value')); } } catch (...
php
public function set($name, $value) { $this->stale = true; try { if ($value === null) { $this->model->where('name', '=', $name)->delete(); } else { $this->model->updateOrCreate(compact('name'), compact('value')); } } catch (...
[ "public", "function", "set", "(", "$", "name", ",", "$", "value", ")", "{", "$", "this", "->", "stale", "=", "true", ";", "try", "{", "if", "(", "$", "value", "===", "null", ")", "{", "$", "this", "->", "model", "->", "where", "(", "'name'", ",...
Updates a setting value. @param string $name @param string|null $value @throws \CachetHQ\Cachet\Settings\WriteException @return void
[ "Updates", "a", "setting", "value", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Settings/Repository.php#L88-L101
220,859
CachetHQ/Cachet
app/Settings/Repository.php
Repository.get
public function get($name, $default = null) { try { if ($setting = $this->model->where('name', '=', $name)->first()) { return $this->castSetting($name, $setting->value); } return $default; } catch (Exception $e) { throw new ReadExcepti...
php
public function get($name, $default = null) { try { if ($setting = $this->model->where('name', '=', $name)->first()) { return $this->castSetting($name, $setting->value); } return $default; } catch (Exception $e) { throw new ReadExcepti...
[ "public", "function", "get", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "try", "{", "if", "(", "$", "setting", "=", "$", "this", "->", "model", "->", "where", "(", "'name'", ",", "'='", ",", "$", "name", ")", "->", "first", "...
Get a setting, or the default value. @param string $name @param mixed $default @throws \CachetHQ\Cachet\Settings\ReadException @return mixed
[ "Get", "a", "setting", "or", "the", "default", "value", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Settings/Repository.php#L113-L124
220,860
CachetHQ/Cachet
app/Settings/Repository.php
Repository.clear
public function clear() { $this->stale = true; try { $this->model->query()->delete(); } catch (Exception $e) { throw new WriteException($e); } }
php
public function clear() { $this->stale = true; try { $this->model->query()->delete(); } catch (Exception $e) { throw new WriteException($e); } }
[ "public", "function", "clear", "(", ")", "{", "$", "this", "->", "stale", "=", "true", ";", "try", "{", "$", "this", "->", "model", "->", "query", "(", ")", "->", "delete", "(", ")", ";", "}", "catch", "(", "Exception", "$", "e", ")", "{", "thr...
Clear all settings. @throws \CachetHQ\Cachet\Settings\WriteException @return void
[ "Clear", "all", "settings", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Settings/Repository.php#L153-L162
220,861
CachetHQ/Cachet
app/Settings/Repository.php
Repository.castSetting
protected function castSetting($key, $value) { if (is_null($value)) { return $value; } if (!in_array($key, $this->notBooleans) && in_array($value, ['0', '1'])) { return (bool) $value; } return $value; }
php
protected function castSetting($key, $value) { if (is_null($value)) { return $value; } if (!in_array($key, $this->notBooleans) && in_array($value, ['0', '1'])) { return (bool) $value; } return $value; }
[ "protected", "function", "castSetting", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "is_null", "(", "$", "value", ")", ")", "{", "return", "$", "value", ";", "}", "if", "(", "!", "in_array", "(", "$", "key", ",", "$", "this", "->", ...
Cast setting as the applicable type. @param string $key @param string $value @return mixed
[ "Cast", "setting", "as", "the", "applicable", "type", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Settings/Repository.php#L182-L193
220,862
CachetHQ/Cachet
app/Presenters/IncidentPresenter.php
IncidentPresenter.icon
public function icon() { if (isset($this->icons[$this->wrappedObject->status])) { return $this->icons[$this->wrappedObject->status]; } }
php
public function icon() { if (isset($this->icons[$this->wrappedObject->status])) { return $this->icons[$this->wrappedObject->status]; } }
[ "public", "function", "icon", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "icons", "[", "$", "this", "->", "wrappedObject", "->", "status", "]", ")", ")", "{", "return", "$", "this", "->", "icons", "[", "$", "this", "->", "wrappedObj...
Present the status with an icon. @return string
[ "Present", "the", "status", "with", "an", "icon", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Presenters/IncidentPresenter.php#L190-L195
220,863
CachetHQ/Cachet
app/Bus/Handlers/Commands/Metric/CreateMetricCommandHandler.php
CreateMetricCommandHandler.handle
public function handle(CreateMetricCommand $command) { $metric = Metric::create([ 'name' => $command->name, 'suffix' => $command->suffix, 'description' => $command->description, 'default_value' => $command->default_value, 'calc_ty...
php
public function handle(CreateMetricCommand $command) { $metric = Metric::create([ 'name' => $command->name, 'suffix' => $command->suffix, 'description' => $command->description, 'default_value' => $command->default_value, 'calc_ty...
[ "public", "function", "handle", "(", "CreateMetricCommand", "$", "command", ")", "{", "$", "metric", "=", "Metric", "::", "create", "(", "[", "'name'", "=>", "$", "command", "->", "name", ",", "'suffix'", "=>", "$", "command", "->", "suffix", ",", "'desc...
Handle the add metric command. @param \CachetHQ\Cachet\Bus\Commands\Metric\CreateMetricCommand $command @return \CachetHQ\Cachet\Models\Metric
[ "Handle", "the", "add", "metric", "command", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Metric/CreateMetricCommandHandler.php#L47-L66
220,864
CachetHQ/Cachet
app/Http/Controllers/Api/ComponentController.php
ComponentController.index
public function index() { if (app(Guard::class)->check()) { $components = Component::query(); } else { $components = Component::enabled(); } if ($tags = Binput::get('tags')) { $components->withAnyTags($tags); } $components->search...
php
public function index() { if (app(Guard::class)->check()) { $components = Component::query(); } else { $components = Component::enabled(); } if ($tags = Binput::get('tags')) { $components->withAnyTags($tags); } $components->search...
[ "public", "function", "index", "(", ")", "{", "if", "(", "app", "(", "Guard", "::", "class", ")", "->", "check", "(", ")", ")", "{", "$", "components", "=", "Component", "::", "query", "(", ")", ";", "}", "else", "{", "$", "components", "=", "Com...
Get all components. @return \Illuminate\Http\JsonResponse
[ "Get", "all", "components", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ComponentController.php#L34-L57
220,865
CachetHQ/Cachet
app/Http/Controllers/Api/ComponentController.php
ComponentController.store
public function store() { try { $component = execute(new CreateComponentCommand( Binput::get('name'), Binput::get('description'), Binput::get('status'), Binput::get('link'), Binput::get('order'), Binp...
php
public function store() { try { $component = execute(new CreateComponentCommand( Binput::get('name'), Binput::get('description'), Binput::get('status'), Binput::get('link'), Binput::get('order'), Binp...
[ "public", "function", "store", "(", ")", "{", "try", "{", "$", "component", "=", "execute", "(", "new", "CreateComponentCommand", "(", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "::", "get", "(", "'description'", ")", ",", "Binput", "::", ...
Create a new component. @return \Illuminate\Http\JsonResponse
[ "Create", "a", "new", "component", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ComponentController.php#L76-L107
220,866
CachetHQ/Cachet
app/Http/Controllers/Api/ComponentController.php
ComponentController.update
public function update(Component $component) { try { execute(new UpdateComponentCommand( $component, Binput::get('name'), Binput::get('description'), Binput::get('status'), Binput::get('link'), Binput...
php
public function update(Component $component) { try { execute(new UpdateComponentCommand( $component, Binput::get('name'), Binput::get('description'), Binput::get('status'), Binput::get('link'), Binput...
[ "public", "function", "update", "(", "Component", "$", "component", ")", "{", "try", "{", "execute", "(", "new", "UpdateComponentCommand", "(", "$", "component", ",", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "::", "get", "(", "'description...
Update an existing component. @param \CachetHQ\Cachet\Models\Component $component @return \Illuminate\Http\JsonResponse
[ "Update", "an", "existing", "component", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Api/ComponentController.php#L116-L149
220,867
CachetHQ/Cachet
app/Http/Controllers/SetupController.php
SetupController.getIndex
public function getIndex() { $supportedLanguages = Request::getLanguages(); $userLanguage = Config::get('app.locale'); foreach ($supportedLanguages as $language) { $language = str_replace('_', '-', $language); if (isset($this->langs[$language])) { $u...
php
public function getIndex() { $supportedLanguages = Request::getLanguages(); $userLanguage = Config::get('app.locale'); foreach ($supportedLanguages as $language) { $language = str_replace('_', '-', $language); if (isset($this->langs[$language])) { $u...
[ "public", "function", "getIndex", "(", ")", "{", "$", "supportedLanguages", "=", "Request", "::", "getLanguages", "(", ")", ";", "$", "userLanguage", "=", "Config", "::", "get", "(", "'app.locale'", ")", ";", "foreach", "(", "$", "supportedLanguages", "as", ...
Returns the setup page. @return \Illuminate\View\View
[ "Returns", "the", "setup", "page", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SetupController.php#L135-L181
220,868
CachetHQ/Cachet
app/Http/Controllers/SetupController.php
SetupController.postStep1
public function postStep1() { $postData = Binput::all(); $v = Validator::make($postData, $this->rulesStep1); $v->sometimes('env.mail_host', 'required', function ($input) { return $input->env['mail_driver'] === 'smtp'; }); $v->sometimes(['env.mail_address', 'env...
php
public function postStep1() { $postData = Binput::all(); $v = Validator::make($postData, $this->rulesStep1); $v->sometimes('env.mail_host', 'required', function ($input) { return $input->env['mail_driver'] === 'smtp'; }); $v->sometimes(['env.mail_address', 'env...
[ "public", "function", "postStep1", "(", ")", "{", "$", "postData", "=", "Binput", "::", "all", "(", ")", ";", "$", "v", "=", "Validator", "::", "make", "(", "$", "postData", ",", "$", "this", "->", "rulesStep1", ")", ";", "$", "v", "->", "sometimes...
Handles validation on step one of the setup form. @return \Illuminate\Http\Response
[ "Handles", "validation", "on", "step", "one", "of", "the", "setup", "form", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SetupController.php#L188-L211
220,869
CachetHQ/Cachet
app/Http/Controllers/SetupController.php
SetupController.postStep2
public function postStep2() { $postData = Binput::all(); $v = Validator::make($postData, $this->rulesStep1 + $this->rulesStep2); if ($v->passes()) { return Response::json(['status' => 1]); } return Response::json(['errors' => $v->getMessageBag()], 400); }
php
public function postStep2() { $postData = Binput::all(); $v = Validator::make($postData, $this->rulesStep1 + $this->rulesStep2); if ($v->passes()) { return Response::json(['status' => 1]); } return Response::json(['errors' => $v->getMessageBag()], 400); }
[ "public", "function", "postStep2", "(", ")", "{", "$", "postData", "=", "Binput", "::", "all", "(", ")", ";", "$", "v", "=", "Validator", "::", "make", "(", "$", "postData", ",", "$", "this", "->", "rulesStep1", "+", "$", "this", "->", "rulesStep2", ...
Handles validation on step two of the setup form. @return \Illuminate\Http\Response
[ "Handles", "validation", "on", "step", "two", "of", "the", "setup", "form", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SetupController.php#L218-L229
220,870
CachetHQ/Cachet
app/Http/Controllers/SetupController.php
SetupController.postStep3
public function postStep3() { $postData = Binput::all(); $v = Validator::make($postData, $this->rulesStep1 + $this->rulesStep2 + $this->rulesStep3); if ($v->passes()) { // Pull the user details out. $userDetails = Arr::pull($postData, 'user'); $user = U...
php
public function postStep3() { $postData = Binput::all(); $v = Validator::make($postData, $this->rulesStep1 + $this->rulesStep2 + $this->rulesStep3); if ($v->passes()) { // Pull the user details out. $userDetails = Arr::pull($postData, 'user'); $user = U...
[ "public", "function", "postStep3", "(", ")", "{", "$", "postData", "=", "Binput", "::", "all", "(", ")", ";", "$", "v", "=", "Validator", "::", "make", "(", "$", "postData", ",", "$", "this", "->", "rulesStep1", "+", "$", "this", "->", "rulesStep2", ...
Handles the actual app setup, including user, settings and env. @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response
[ "Handles", "the", "actual", "app", "setup", "including", "user", "settings", "and", "env", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/SetupController.php#L236-L280
220,871
CachetHQ/Cachet
app/Foundation/Providers/IntegrationServiceProvider.php
IntegrationServiceProvider.registerBeacon
protected function registerBeacon() { $this->app->singleton(BeaconContract::class, function ($app) { $config = $app['config']; return new Beacon($config); }); }
php
protected function registerBeacon() { $this->app->singleton(BeaconContract::class, function ($app) { $config = $app['config']; return new Beacon($config); }); }
[ "protected", "function", "registerBeacon", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "BeaconContract", "::", "class", ",", "function", "(", "$", "app", ")", "{", "$", "config", "=", "$", "app", "[", "'config'", "]", ";", "return"...
Register the beacon class. @return void
[ "Register", "the", "beacon", "class", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/IntegrationServiceProvider.php#L54-L61
220,872
CachetHQ/Cachet
app/Foundation/Providers/IntegrationServiceProvider.php
IntegrationServiceProvider.registerCredits
protected function registerCredits() { $this->app->singleton(CreditsContract::class, function ($app) { $cache = $app['cache.store']; return new Credits($cache); }); }
php
protected function registerCredits() { $this->app->singleton(CreditsContract::class, function ($app) { $cache = $app['cache.store']; return new Credits($cache); }); }
[ "protected", "function", "registerCredits", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "CreditsContract", "::", "class", ",", "function", "(", "$", "app", ")", "{", "$", "cache", "=", "$", "app", "[", "'cache.store'", "]", ";", "r...
Register the credits class. @return void
[ "Register", "the", "credits", "class", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/IntegrationServiceProvider.php#L68-L75
220,873
CachetHQ/Cachet
app/Foundation/Providers/IntegrationServiceProvider.php
IntegrationServiceProvider.registerFeed
protected function registerFeed() { $this->app->singleton(FeedContract::class, function ($app) { $cache = $app['cache.store']; return new Feed($cache); }); }
php
protected function registerFeed() { $this->app->singleton(FeedContract::class, function ($app) { $cache = $app['cache.store']; return new Feed($cache); }); }
[ "protected", "function", "registerFeed", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "FeedContract", "::", "class", ",", "function", "(", "$", "app", ")", "{", "$", "cache", "=", "$", "app", "[", "'cache.store'", "]", ";", "return"...
Register the feed class. @return void
[ "Register", "the", "feed", "class", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/IntegrationServiceProvider.php#L82-L89
220,874
CachetHQ/Cachet
app/Foundation/Providers/IntegrationServiceProvider.php
IntegrationServiceProvider.registerSystem
protected function registerSystem() { $this->app->singleton(SystemContract::class, function (Container $app) { $config = $app['config']; $auth = $app['auth.driver']; return new System($config, $auth); }); }
php
protected function registerSystem() { $this->app->singleton(SystemContract::class, function (Container $app) { $config = $app['config']; $auth = $app['auth.driver']; return new System($config, $auth); }); }
[ "protected", "function", "registerSystem", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "SystemContract", "::", "class", ",", "function", "(", "Container", "$", "app", ")", "{", "$", "config", "=", "$", "app", "[", "'config'", "]", ...
Register the system class. @return void
[ "Register", "the", "system", "class", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/IntegrationServiceProvider.php#L96-L104
220,875
CachetHQ/Cachet
app/Foundation/Providers/IntegrationServiceProvider.php
IntegrationServiceProvider.registerReleases
protected function registerReleases() { $this->app->singleton(ReleasesContract::class, function ($app) { $cache = $app['cache.store']; $token = $app['config']->get('services.github.token'); return new Releases($cache, $token); }); }
php
protected function registerReleases() { $this->app->singleton(ReleasesContract::class, function ($app) { $cache = $app['cache.store']; $token = $app['config']->get('services.github.token'); return new Releases($cache, $token); }); }
[ "protected", "function", "registerReleases", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "ReleasesContract", "::", "class", ",", "function", "(", "$", "app", ")", "{", "$", "cache", "=", "$", "app", "[", "'cache.store'", "]", ";", ...
Register the releases class. @return void
[ "Register", "the", "releases", "class", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Foundation/Providers/IntegrationServiceProvider.php#L111-L119
220,876
CachetHQ/Cachet
app/Bus/Handlers/Commands/System/Config/UpdateConfigCommandHandler.php
UpdateConfigCommandHandler.handle
public function handle(UpdateConfigCommand $command) { foreach ($command->values as $setting => $value) { $this->writeEnv($setting, $value); } }
php
public function handle(UpdateConfigCommand $command) { foreach ($command->values as $setting => $value) { $this->writeEnv($setting, $value); } }
[ "public", "function", "handle", "(", "UpdateConfigCommand", "$", "command", ")", "{", "foreach", "(", "$", "command", "->", "values", "as", "$", "setting", "=>", "$", "value", ")", "{", "$", "this", "->", "writeEnv", "(", "$", "setting", ",", "$", "val...
Handle update config command handler instance. @param \CachetHQ\Cachet\Bus\Commands\System\Config\UpdateConfigCommand $command @return void
[ "Handle", "update", "config", "command", "handler", "instance", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/System/Config/UpdateConfigCommandHandler.php#L32-L37
220,877
CachetHQ/Cachet
app/Bus/Handlers/Commands/System/Config/UpdateConfigCommandHandler.php
UpdateConfigCommandHandler.writeEnv
protected function writeEnv($key, $value) { $dir = app()->environmentPath(); $file = app()->environmentFile(); $path = "{$dir}/{$file}"; try { (new Dotenv($dir, $file))->load(); $envKey = strtoupper($key); $envValue = env($envKey) ?: 'null'; ...
php
protected function writeEnv($key, $value) { $dir = app()->environmentPath(); $file = app()->environmentFile(); $path = "{$dir}/{$file}"; try { (new Dotenv($dir, $file))->load(); $envKey = strtoupper($key); $envValue = env($envKey) ?: 'null'; ...
[ "protected", "function", "writeEnv", "(", "$", "key", ",", "$", "value", ")", "{", "$", "dir", "=", "app", "(", ")", "->", "environmentPath", "(", ")", ";", "$", "file", "=", "app", "(", ")", "->", "environmentFile", "(", ")", ";", "$", "path", "...
Writes to the .env file with given parameters. @param string $key @param mixed $value @return void
[ "Writes", "to", "the", ".", "env", "file", "with", "given", "parameters", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/System/Config/UpdateConfigCommandHandler.php#L47-L67
220,878
CachetHQ/Cachet
app/Models/MetricPoint.php
MetricPoint.setCreatedAtAttribute
public function setCreatedAtAttribute($createdAt) { if (!$createdAt) { return; } if (!$createdAt instanceof DateTime) { $createdAt = Carbon::parse($createdAt); } $timestamp = $createdAt->format('U'); $timestamp = 30 * round($timestamp / 30); ...
php
public function setCreatedAtAttribute($createdAt) { if (!$createdAt) { return; } if (!$createdAt instanceof DateTime) { $createdAt = Carbon::parse($createdAt); } $timestamp = $createdAt->format('U'); $timestamp = 30 * round($timestamp / 30); ...
[ "public", "function", "setCreatedAtAttribute", "(", "$", "createdAt", ")", "{", "if", "(", "!", "$", "createdAt", ")", "{", "return", ";", "}", "if", "(", "!", "$", "createdAt", "instanceof", "DateTime", ")", "{", "$", "createdAt", "=", "Carbon", "::", ...
Round the created at value into intervals of 30 seconds. @param string $createdAt @return string|void
[ "Round", "the", "created", "at", "value", "into", "intervals", "of", "30", "seconds", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/MetricPoint.php#L110-L128
220,879
CachetHQ/Cachet
app/Http/Controllers/StatusPageController.php
StatusPageController.getMetrics
public function getMetrics(Metric $metric) { $type = Binput::get('filter', AutoPresenter::decorate($metric)->view_name); $metrics = app(MetricRepository::class); switch ($type) { case 'last_hour': $metricData = $metrics->listPointsLastHour($metric); break; case 'toda...
php
public function getMetrics(Metric $metric) { $type = Binput::get('filter', AutoPresenter::decorate($metric)->view_name); $metrics = app(MetricRepository::class); switch ($type) { case 'last_hour': $metricData = $metrics->listPointsLastHour($metric); break; case 'toda...
[ "public", "function", "getMetrics", "(", "Metric", "$", "metric", ")", "{", "$", "type", "=", "Binput", "::", "get", "(", "'filter'", ",", "AutoPresenter", "::", "decorate", "(", "$", "metric", ")", "->", "view_name", ")", ";", "$", "metrics", "=", "ap...
Returns metrics in a readily formatted way. @param \CachetHQ\Cachet\Models\Metric $metric @return \Illuminate\Http\JsonResponse
[ "Returns", "metrics", "in", "a", "readily", "formatted", "way", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/StatusPageController.php#L165-L182
220,880
CachetHQ/Cachet
app/Bus/Handlers/Commands/Component/RemoveComponentCommandHandler.php
RemoveComponentCommandHandler.handle
public function handle(RemoveComponentCommand $command) { $component = $command->component; event(new ComponentWasRemovedEvent($this->auth->user(), $component)); $component->delete(); }
php
public function handle(RemoveComponentCommand $command) { $component = $command->component; event(new ComponentWasRemovedEvent($this->auth->user(), $component)); $component->delete(); }
[ "public", "function", "handle", "(", "RemoveComponentCommand", "$", "command", ")", "{", "$", "component", "=", "$", "command", "->", "component", ";", "event", "(", "new", "ComponentWasRemovedEvent", "(", "$", "this", "->", "auth", "->", "user", "(", ")", ...
Handle the remove component command. @param \CachetHQ\Cachet\Bus\Commands\Component\RemoveComponentCommand $command @return void
[ "Handle", "the", "remove", "component", "command", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Component/RemoveComponentCommandHandler.php#L46-L53
220,881
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ComponentController.php
ComponentController.showComponents
public function showComponents() { $components = Component::with('group')->orderBy('order')->orderBy('created_at')->get(); $this->subMenu['components']['active'] = true; return View::make('dashboard.components.index') ->withPageTitle(trans_choice('dashboard.components.component...
php
public function showComponents() { $components = Component::with('group')->orderBy('order')->orderBy('created_at')->get(); $this->subMenu['components']['active'] = true; return View::make('dashboard.components.index') ->withPageTitle(trans_choice('dashboard.components.component...
[ "public", "function", "showComponents", "(", ")", "{", "$", "components", "=", "Component", "::", "with", "(", "'group'", ")", "->", "orderBy", "(", "'order'", ")", "->", "orderBy", "(", "'created_at'", ")", "->", "get", "(", ")", ";", "$", "this", "->...
Shows the components view. @return \Illuminate\View\View
[ "Shows", "the", "components", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ComponentController.php#L75-L85
220,882
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ComponentController.php
ComponentController.showEditComponent
public function showEditComponent(Component $component) { $groups = ComponentGroup::all(); $pageTitle = sprintf('"%s" - %s - %s', $component->name, trans('dashboard.components.edit.title'), trans('dashboard.dashboard')); return View::make('dashboard.components.edit') ->withPage...
php
public function showEditComponent(Component $component) { $groups = ComponentGroup::all(); $pageTitle = sprintf('"%s" - %s - %s', $component->name, trans('dashboard.components.edit.title'), trans('dashboard.dashboard')); return View::make('dashboard.components.edit') ->withPage...
[ "public", "function", "showEditComponent", "(", "Component", "$", "component", ")", "{", "$", "groups", "=", "ComponentGroup", "::", "all", "(", ")", ";", "$", "pageTitle", "=", "sprintf", "(", "'\"%s\" - %s - %s'", ",", "$", "component", "->", "name", ",", ...
Shows the edit component view. @param \CachetHQ\Cachet\Models\Component $component @return \Illuminate\View\View
[ "Shows", "the", "edit", "component", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ComponentController.php#L94-L104
220,883
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ComponentController.php
ComponentController.updateComponentAction
public function updateComponentAction(Component $component) { $componentData = Binput::get('component'); $tags = Arr::pull($componentData, 'tags'); try { $component = execute(new UpdateComponentCommand( $component, $componentData['name'], ...
php
public function updateComponentAction(Component $component) { $componentData = Binput::get('component'); $tags = Arr::pull($componentData, 'tags'); try { $component = execute(new UpdateComponentCommand( $component, $componentData['name'], ...
[ "public", "function", "updateComponentAction", "(", "Component", "$", "component", ")", "{", "$", "componentData", "=", "Binput", "::", "get", "(", "'component'", ")", ";", "$", "tags", "=", "Arr", "::", "pull", "(", "$", "componentData", ",", "'tags'", ")...
Updates a component. @param \CachetHQ\Cachet\Models\Component $component @return \Illuminate\Http\RedirectResponse
[ "Updates", "a", "component", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ComponentController.php#L113-L151
220,884
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ComponentController.php
ComponentController.deleteComponentAction
public function deleteComponentAction(Component $component) { execute(new RemoveComponentCommand($component)); return cachet_redirect('dashboard.components') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); }
php
public function deleteComponentAction(Component $component) { execute(new RemoveComponentCommand($component)); return cachet_redirect('dashboard.components') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); }
[ "public", "function", "deleteComponentAction", "(", "Component", "$", "component", ")", "{", "execute", "(", "new", "RemoveComponentCommand", "(", "$", "component", ")", ")", ";", "return", "cachet_redirect", "(", "'dashboard.components'", ")", "->", "withSuccess", ...
Deletes a given component. @param \CachetHQ\Cachet\Models\Component $component @return \Illuminate\Http\RedirectResponse
[ "Deletes", "a", "given", "component", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ComponentController.php#L213-L219
220,885
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ScheduleController.php
ScheduleController.showIndex
public function showIndex() { $schedule = Schedule::orderBy('created_at')->get(); return View::make('dashboard.maintenance.index') ->withPageTitle(trans('dashboard.schedule.schedule').' - '.trans('dashboard.dashboard')) ->withSchedule($schedule); }
php
public function showIndex() { $schedule = Schedule::orderBy('created_at')->get(); return View::make('dashboard.maintenance.index') ->withPageTitle(trans('dashboard.schedule.schedule').' - '.trans('dashboard.dashboard')) ->withSchedule($schedule); }
[ "public", "function", "showIndex", "(", ")", "{", "$", "schedule", "=", "Schedule", "::", "orderBy", "(", "'created_at'", ")", "->", "get", "(", ")", ";", "return", "View", "::", "make", "(", "'dashboard.maintenance.index'", ")", "->", "withPageTitle", "(", ...
Lists all scheduled maintenance. @return \Illuminate\View\View
[ "Lists", "all", "scheduled", "maintenance", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ScheduleController.php#L53-L60
220,886
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ScheduleController.php
ScheduleController.showAddSchedule
public function showAddSchedule() { $incidentTemplates = IncidentTemplate::all(); return View::make('dashboard.maintenance.add') ->withPageTitle(trans('dashboard.schedule.add.title').' - '.trans('dashboard.dashboard')) ->withIncidentTemplates($incidentTemplates); }
php
public function showAddSchedule() { $incidentTemplates = IncidentTemplate::all(); return View::make('dashboard.maintenance.add') ->withPageTitle(trans('dashboard.schedule.add.title').' - '.trans('dashboard.dashboard')) ->withIncidentTemplates($incidentTemplates); }
[ "public", "function", "showAddSchedule", "(", ")", "{", "$", "incidentTemplates", "=", "IncidentTemplate", "::", "all", "(", ")", ";", "return", "View", "::", "make", "(", "'dashboard.maintenance.add'", ")", "->", "withPageTitle", "(", "trans", "(", "'dashboard....
Shows the add schedule maintenance form. @return \Illuminate\View\View
[ "Shows", "the", "add", "schedule", "maintenance", "form", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ScheduleController.php#L67-L74
220,887
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ScheduleController.php
ScheduleController.addScheduleAction
public function addScheduleAction() { try { execute(new CreateScheduleCommand( Binput::get('name'), Binput::get('message', null, false, false), Binput::get('status', Schedule::UPCOMING), Binput::get('scheduled_at'), ...
php
public function addScheduleAction() { try { execute(new CreateScheduleCommand( Binput::get('name'), Binput::get('message', null, false, false), Binput::get('status', Schedule::UPCOMING), Binput::get('scheduled_at'), ...
[ "public", "function", "addScheduleAction", "(", ")", "{", "try", "{", "execute", "(", "new", "CreateScheduleCommand", "(", "Binput", "::", "get", "(", "'name'", ")", ",", "Binput", "::", "get", "(", "'message'", ",", "null", ",", "false", ",", "false", "...
Creates a new scheduled maintenance. @return \Illuminate\Http\RedirectResponse
[ "Creates", "a", "new", "scheduled", "maintenance", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ScheduleController.php#L81-L101
220,888
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ScheduleController.php
ScheduleController.showEditSchedule
public function showEditSchedule(Schedule $schedule) { $incidentTemplates = IncidentTemplate::all(); return View::make('dashboard.maintenance.edit') ->withPageTitle(trans('dashboard.schedule.edit.title').' - '.trans('dashboard.dashboard')) ->withIncidentTemplates($incidentTe...
php
public function showEditSchedule(Schedule $schedule) { $incidentTemplates = IncidentTemplate::all(); return View::make('dashboard.maintenance.edit') ->withPageTitle(trans('dashboard.schedule.edit.title').' - '.trans('dashboard.dashboard')) ->withIncidentTemplates($incidentTe...
[ "public", "function", "showEditSchedule", "(", "Schedule", "$", "schedule", ")", "{", "$", "incidentTemplates", "=", "IncidentTemplate", "::", "all", "(", ")", ";", "return", "View", "::", "make", "(", "'dashboard.maintenance.edit'", ")", "->", "withPageTitle", ...
Shows the edit schedule maintenance form. @param \CachetHQ\Cachet\Models\Schedule $schedule @return \Illuminate\View\View
[ "Shows", "the", "edit", "schedule", "maintenance", "form", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ScheduleController.php#L110-L118
220,889
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ScheduleController.php
ScheduleController.editScheduleAction
public function editScheduleAction(Schedule $schedule) { try { $schedule = execute(new UpdateScheduleCommand( $schedule, Binput::get('name', null), Binput::get('message', null), Binput::get('status', null), Binput::g...
php
public function editScheduleAction(Schedule $schedule) { try { $schedule = execute(new UpdateScheduleCommand( $schedule, Binput::get('name', null), Binput::get('message', null), Binput::get('status', null), Binput::g...
[ "public", "function", "editScheduleAction", "(", "Schedule", "$", "schedule", ")", "{", "try", "{", "$", "schedule", "=", "execute", "(", "new", "UpdateScheduleCommand", "(", "$", "schedule", ",", "Binput", "::", "get", "(", "'name'", ",", "null", ")", ","...
Updates the given incident. @param \CachetHQ\Cachet\Models\Schedule $schedule @return \Illuminate\Http\RedirectResponse
[ "Updates", "the", "given", "incident", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ScheduleController.php#L127-L148
220,890
CachetHQ/Cachet
app/Http/Controllers/Dashboard/ScheduleController.php
ScheduleController.deleteScheduleAction
public function deleteScheduleAction(Schedule $schedule) { execute(new DeleteScheduleCommand($schedule)); return cachet_redirect('dashboard.schedule') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success'))); }
php
public function deleteScheduleAction(Schedule $schedule) { execute(new DeleteScheduleCommand($schedule)); return cachet_redirect('dashboard.schedule') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success'))); }
[ "public", "function", "deleteScheduleAction", "(", "Schedule", "$", "schedule", ")", "{", "execute", "(", "new", "DeleteScheduleCommand", "(", "$", "schedule", ")", ")", ";", "return", "cachet_redirect", "(", "'dashboard.schedule'", ")", "->", "withSuccess", "(", ...
Deletes a given schedule. @param \CachetHQ\Cachet\Models\Schedule $schedule @return \Illuminate\Http\RedirectResponse
[ "Deletes", "a", "given", "schedule", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/ScheduleController.php#L157-L163
220,891
CachetHQ/Cachet
app/Presenters/ComponentGroupPresenter.php
ComponentGroupPresenter.enabled_components_lowest
public function enabled_components_lowest() { if (is_bool($this->enabledComponentsLowest)) { $this->enabledComponentsLowest = $this->wrappedObject->enabled_components_lowest()->first(); } return $this->enabledComponentsLowest; }
php
public function enabled_components_lowest() { if (is_bool($this->enabledComponentsLowest)) { $this->enabledComponentsLowest = $this->wrappedObject->enabled_components_lowest()->first(); } return $this->enabledComponentsLowest; }
[ "public", "function", "enabled_components_lowest", "(", ")", "{", "if", "(", "is_bool", "(", "$", "this", "->", "enabledComponentsLowest", ")", ")", "{", "$", "this", "->", "enabledComponentsLowest", "=", "$", "this", "->", "wrappedObject", "->", "enabled_compon...
Return the enabled components from the wrapped object, and cache it if need be. @return bool
[ "Return", "the", "enabled", "components", "from", "the", "wrapped", "object", "and", "cache", "it", "if", "need", "be", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Presenters/ComponentGroupPresenter.php#L71-L78
220,892
CachetHQ/Cachet
app/Presenters/ComponentGroupPresenter.php
ComponentGroupPresenter.is_collapsed
public function is_collapsed() { if ($this->wrappedObject->collapsed === 0) { return false; } elseif ($this->wrappedObject->collapsed === 1) { return true; } return $this->wrappedObject->components->filter(function ($component) { return $component...
php
public function is_collapsed() { if ($this->wrappedObject->collapsed === 0) { return false; } elseif ($this->wrappedObject->collapsed === 1) { return true; } return $this->wrappedObject->components->filter(function ($component) { return $component...
[ "public", "function", "is_collapsed", "(", ")", "{", "if", "(", "$", "this", "->", "wrappedObject", "->", "collapsed", "===", "0", ")", "{", "return", "false", ";", "}", "elseif", "(", "$", "this", "->", "wrappedObject", "->", "collapsed", "===", "1", ...
Determine if the group should be collapsed. @return bool
[ "Determine", "if", "the", "group", "should", "be", "collapsed", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Presenters/ComponentGroupPresenter.php#L95-L106
220,893
CachetHQ/Cachet
app/Presenters/ComponentGroupPresenter.php
ComponentGroupPresenter.has_subscriber
public function has_subscriber($subscriptions) { $enabled_components = $this->wrappedObject->enabled_components()->orderBy('order')->pluck('id')->toArray(); $intersected = array_intersect($enabled_components, $subscriptions); return count($intersected) != 0; }
php
public function has_subscriber($subscriptions) { $enabled_components = $this->wrappedObject->enabled_components()->orderBy('order')->pluck('id')->toArray(); $intersected = array_intersect($enabled_components, $subscriptions); return count($intersected) != 0; }
[ "public", "function", "has_subscriber", "(", "$", "subscriptions", ")", "{", "$", "enabled_components", "=", "$", "this", "->", "wrappedObject", "->", "enabled_components", "(", ")", "->", "orderBy", "(", "'order'", ")", "->", "pluck", "(", "'id'", ")", "->"...
Determine if any of the contained components have active subscriptions. @return bool
[ "Determine", "if", "any", "of", "the", "contained", "components", "have", "active", "subscriptions", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Presenters/ComponentGroupPresenter.php#L127-L133
220,894
CachetHQ/Cachet
app/Bus/Handlers/Commands/Metric/RemoveMetricPointCommandHandler.php
RemoveMetricPointCommandHandler.handle
public function handle(RemoveMetricPointCommand $command) { $metricPoint = $command->metricPoint; event(new MetricPointWasRemovedEvent($this->auth->user(), $metricPoint)); $metricPoint->delete(); }
php
public function handle(RemoveMetricPointCommand $command) { $metricPoint = $command->metricPoint; event(new MetricPointWasRemovedEvent($this->auth->user(), $metricPoint)); $metricPoint->delete(); }
[ "public", "function", "handle", "(", "RemoveMetricPointCommand", "$", "command", ")", "{", "$", "metricPoint", "=", "$", "command", "->", "metricPoint", ";", "event", "(", "new", "MetricPointWasRemovedEvent", "(", "$", "this", "->", "auth", "->", "user", "(", ...
Handle the remove metric point command. @param \CachetHQ\Cachet\Bus\Commands\Metric\RemoveMetricPointCommand $command @return void
[ "Handle", "the", "remove", "metric", "point", "command", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Bus/Handlers/Commands/Metric/RemoveMetricPointCommandHandler.php#L47-L54
220,895
CachetHQ/Cachet
app/Models/Component.php
Component.scopeAuthenticated
public function scopeAuthenticated(Builder $query, $authenticated) { return $query->when(!$authenticated, function (Builder $query) { return $query->whereDoesntHave('group', function (Builder $query) { $query->where('visible', ComponentGroup::VISIBLE_AUTHENTICATED); }...
php
public function scopeAuthenticated(Builder $query, $authenticated) { return $query->when(!$authenticated, function (Builder $query) { return $query->whereDoesntHave('group', function (Builder $query) { $query->where('visible', ComponentGroup::VISIBLE_AUTHENTICATED); }...
[ "public", "function", "scopeAuthenticated", "(", "Builder", "$", "query", ",", "$", "authenticated", ")", "{", "return", "$", "query", "->", "when", "(", "!", "$", "authenticated", ",", "function", "(", "Builder", "$", "query", ")", "{", "return", "$", "...
Find all components which are within visible groups. @param \Illuminate\Database\Eloquent\Builder $query @param bool $authenticated @return \Illuminate\Database\Eloquent\Builder
[ "Find", "all", "components", "which", "are", "within", "visible", "groups", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/Component.php#L189-L196
220,896
CachetHQ/Cachet
app/Http/Controllers/Dashboard/DashboardController.php
DashboardController.showDashboard
public function showDashboard() { $components = Component::orderBy('order')->get(); $incidents = $this->getIncidents(); $subscribers = $this->getSubscribers(); $componentGroups = $this->getVisibleGroupedComponents(); $ungroupedComponents = Component::ungrouped()->get(); ...
php
public function showDashboard() { $components = Component::orderBy('order')->get(); $incidents = $this->getIncidents(); $subscribers = $this->getSubscribers(); $componentGroups = $this->getVisibleGroupedComponents(); $ungroupedComponents = Component::ungrouped()->get(); ...
[ "public", "function", "showDashboard", "(", ")", "{", "$", "components", "=", "Component", "::", "orderBy", "(", "'order'", ")", "->", "get", "(", ")", ";", "$", "incidents", "=", "$", "this", "->", "getIncidents", "(", ")", ";", "$", "subscribers", "=...
Shows the dashboard view. @return \Illuminate\View\View
[ "Shows", "the", "dashboard", "view", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/DashboardController.php#L93-L123
220,897
CachetHQ/Cachet
app/Http/Controllers/Dashboard/DashboardController.php
DashboardController.getIncidents
protected function getIncidents() { $allIncidents = Incident::whereBetween('occurred_at', [ $this->startDate->copy()->subDays(30)->format('Y-m-d').' 00:00:00', $this->startDate->format('Y-m-d').' 23:59:59', ])->orderBy('occurred_at', 'desc')->get()->groupBy(function (Incident...
php
protected function getIncidents() { $allIncidents = Incident::whereBetween('occurred_at', [ $this->startDate->copy()->subDays(30)->format('Y-m-d').' 00:00:00', $this->startDate->format('Y-m-d').' 23:59:59', ])->orderBy('occurred_at', 'desc')->get()->groupBy(function (Incident...
[ "protected", "function", "getIncidents", "(", ")", "{", "$", "allIncidents", "=", "Incident", "::", "whereBetween", "(", "'occurred_at'", ",", "[", "$", "this", "->", "startDate", "->", "copy", "(", ")", "->", "subDays", "(", "30", ")", "->", "format", "...
Fetches all of the incidents over the last 30 days. @return \Illuminate\Support\Collection
[ "Fetches", "all", "of", "the", "incidents", "over", "the", "last", "30", "days", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/DashboardController.php#L130-L155
220,898
CachetHQ/Cachet
app/Http/Controllers/Dashboard/DashboardController.php
DashboardController.getSubscribers
protected function getSubscribers() { $allSubscribers = Subscriber::whereBetween('created_at', [ $this->startDate->copy()->subDays(30)->format('Y-m-d').' 00:00:00', $this->startDate->format('Y-m-d').' 23:59:59', ])->orderBy('created_at', 'desc')->get()->groupBy(function (Subs...
php
protected function getSubscribers() { $allSubscribers = Subscriber::whereBetween('created_at', [ $this->startDate->copy()->subDays(30)->format('Y-m-d').' 00:00:00', $this->startDate->format('Y-m-d').' 23:59:59', ])->orderBy('created_at', 'desc')->get()->groupBy(function (Subs...
[ "protected", "function", "getSubscribers", "(", ")", "{", "$", "allSubscribers", "=", "Subscriber", "::", "whereBetween", "(", "'created_at'", ",", "[", "$", "this", "->", "startDate", "->", "copy", "(", ")", "->", "subDays", "(", "30", ")", "->", "format"...
Fetches all of the subscribers over the last 30 days. @return \Illuminate\Support\Collection
[ "Fetches", "all", "of", "the", "subscribers", "over", "the", "last", "30", "days", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Http/Controllers/Dashboard/DashboardController.php#L162-L187
220,899
CachetHQ/Cachet
app/Models/Traits/SearchableTrait.php
SearchableTrait.scopeSearch
public function scopeSearch(Builder $query, array $search = []) { if (empty($search)) { return $query; } if (!array_intersect(array_keys($search), $this->searchable)) { return $query; } return $query->where($search); }
php
public function scopeSearch(Builder $query, array $search = []) { if (empty($search)) { return $query; } if (!array_intersect(array_keys($search), $this->searchable)) { return $query; } return $query->where($search); }
[ "public", "function", "scopeSearch", "(", "Builder", "$", "query", ",", "array", "$", "search", "=", "[", "]", ")", "{", "if", "(", "empty", "(", "$", "search", ")", ")", "{", "return", "$", "query", ";", "}", "if", "(", "!", "array_intersect", "("...
Adds a search scope. @param \Illuminate\Database\Eloquent\Builder $query @param array $search @return \Illuminate\Database\Eloquent\Builder
[ "Adds", "a", "search", "scope", "." ]
ae35e1f9d0ce643ca2dbc544fa4172861ee56288
https://github.com/CachetHQ/Cachet/blob/ae35e1f9d0ce643ca2dbc544fa4172861ee56288/app/Models/Traits/SearchableTrait.php#L31-L42