getWidgetBySLUG() публичный статический Метод

Find Widgets by given slug.
public static getWidgetBySLUG ( integer $slug ) : Collection | null | static | Widgets
$slug integer
Результат Illuminate\Support\Collection | null | static | Widgets
Пример #1
0
 /**
  * Get a widget.
  *
  * @param string $slug
  *
  * @return widget
  */
 public function widget($slug)
 {
     $widget = WidgetRepository::getWidgetBySLUG($slug);
     if (Gate::allows('quarx', Auth::user())) {
         $widget->content .= '<a href="' . url('quarx/widgets/' . $widget->id . '/edit') . '" style="margin-left: 8px;" class="btn btn-xs btn-default"><span class="fa fa-pencil"></span> Edit</a>';
     }
     return $widget->content;
 }