Skip to content

Commit

Permalink
Добавляет getIdFromSlug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagepard committed Sep 20, 2017
1 parent dc3d008 commit f394eed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/Http/Supports/CommonHelper.php
Expand Up @@ -5,6 +5,18 @@
trait CommonHelper
{

/**
* @param $slug
*
* @return string
*/
protected function getIdFromSlug(string $slug) :string
{
$slug = strip_tags($slug);

return (strpos($slug, '_') !== false) ? strstr($slug, '_', true) : $slug;
}

/**
* @param string $uri
*
Expand Down

0 comments on commit f394eed

Please sign in to comment.