Ejemplo n.º 1
0
 /**
  * Generate a slug for the user.
  *
  * @param $username
  * @return string
  */
 public function generateSlug($username)
 {
     $slug = \SlugGenerator::generateSlug($username);
     return $this->exists($slug) ? $slug . "-" . mt_rand(0, 10000) : $slug;
 }
Ejemplo n.º 2
0
 /**
  * Generate a slug for the course.
  *
  * @param Course $course
  * @return string
  */
 private function generateSlug(Course $course)
 {
     $slug = \SlugGenerator::generateSlug($course->title);
     return $this->exists($slug) ? $slug . "-" . $course->id : $slug;
 }