(show poster on checkout page if concert has one)

This commit is contained in:
Adam Wathan
2017-11-14 12:14:34 -05:00
parent 21050b04f4
commit 2f8d0ed425
9 changed files with 365 additions and 266 deletions

View File

@@ -3,6 +3,7 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
use App\Exceptions\NotEnoughTicketsException;
class Concert extends Model
@@ -124,4 +125,14 @@ class Concert extends Model
{
return $this->orders()->sum('amount') / 100;
}
public function hasPoster()
{
return $this->poster_image_path !== null;
}
public function posterUrl()
{
return Storage::disk('public')->url($this->poster_image_path);
}
}