public function promotion($slug)
    {
        $promotion = app(PromotionRepository::class)->getBySlug($slug);

        if ($promotion) {
            if (Gate::allows('cms', Auth::user())) {
                $promotion->details .= '<a href="'.url(config('cms.backend-route-prefix', 'cms').'/promotions/'.$promotion->id.'/edit').'" style="margin-left: 8px;" class="btn btn-xs btn-default"><span class="fa fa-pencil"></span> Edit</a>';
            }

            if ($promotion->is_published) {
                if (config('app.locale') !== config('cms.default-language') && $promotion->translation(config('app.locale'))) {
                    return $promotion->translationData(config('app.locale'))->details;
                } else {
                    return $promotion->details;
                }
            }
        }

        return '';
    }
public function promotion($slug)
    {
        $promotion = app(PromotionRepository::class)->getBySlug($slug);

        if ($promotion) {
            if (Gate::allows('cms', Auth::user())) {
                $promotion->details .= '<a href="'.url(config('cms.backend-route-prefix', 'cms').'/promotions/'.$promotion->id.'/edit').'" style="margin-left: 8px;" class="btn btn-xs btn-default"><span class="fa fa-pencil"></span> Edit</a>';
            }

            if ($promotion->is_published) {
                if (config('app.locale') !== config('cms.default-language') && $promotion->translation(config('app.locale'))) {
                    return $promotion->translationData(config('app.locale'))->details;
                } else {
                    return $promotion->details;
                }
            }
        }

        return '';
    }
public function promotion ( $ slug ) { $ promotion = app ( PromotionRepository :: class ) -> getBySlug ( $ slug ) ; if ( $ promotion ) { if ( Gate :: allows ( 'cms' , Auth :: user ( ) ) ) { $ promotion -> details .= '<a href="' . url ( config ( 'cms.backend-route-prefix' , 'cms' ) . '/promotions/' . $ promotion -> id . '/edit' ) . '" style="margin-left: 8px;" class="btn btn-xs btn-default"><span class="fa fa-pencil"></span> Edit</a>' ; } if ( $ promotion -> is_published ) { if ( config ( 'app.locale' ) !== config ( 'cms.default-language' ) && $ promotion -> translation ( config ( 'app.locale' ) ) ) { return $ promotion -> translationData ( config ( 'app.locale' ) ) -> details ; } else { return $ promotion -> details ; } } } return '' ; }
Get an promotion.

@param string $slug

@return promotion
Get an promotion .