コード例 #1
0
ファイル: Track.php プロジェクト: jenky/muzik
 /**
  * Get the permalink url.
  * 
  * @return string
  */
 public function getPermalinkUrlAttribute()
 {
     return root_domain(url('t/' . str_slug($this->permalink)));
 }
コード例 #2
0
ファイル: ImageResponse.php プロジェクト: projnoah/noah
 /**
  * Sends the image response.
  *
  * @param      $path
  * @param bool $storage
  * @return mixed
  *
  * @author Cali
  */
 protected function imageResponse($path, $storage = true)
 {
     return response($storage ? Storage::get($path) : file_get_contents(public_path($path)), 200, ['Content-type' => 'image', 'Access-Control-Allow-Origin' => request()->secure() ? 'https://' : 'http://' . root_domain()]);
 }