Example #1
0
 public function showServices(Map $map, Request $request, ShortenLink $shortenLink)
 {
     $lat = $map->getLat();
     $lng = $map->getLng();
     $link = $shortenLink->shortenUrl($request->url());
     $shortLink = $link->getShortUrl();
     return view('pages.services', compact('lat', 'lng', 'shortLink'));
 }
Example #2
0
 public function showPost($slug, Request $request, ShortenLink $shortenLink)
 {
     $post = Post::with('tags')->whereSlug($slug)->firstOrFail();
     $tag = $request->get('tag');
     $link = $shortenLink->shortenUrl($request->url());
     $shortLink = $link->getShortUrl();
     if ($tag) {
         $tag = Tag::whereTag($tag)->firstOrFail();
     }
     return view($post->layout, compact('post', 'tag', 'slug', 'shortLink'));
 }