Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

phpreel/phpreel

126 stars
5 code files
View phpreel/phpreel on GitHub

app/View/Components/AvailabilityForm.php

Open in GitHub
use Illuminate\View\Component;
 
class AvailabilityForm extends Component
{
public $type;
 
public $content;
 
public function __construct($type, $content=null)
{
$this->type = $type;
$this->content = $content;
}
 
public function render()
{
return view("components.$this->type.availability-form", [
'content' => $this->content,
]);
}
}

resources/views/components/create/availability-form.blade.php

Open in GitHub
<div class="form-group">
<label for="availability">Availability</label><br>
 
<select name="availability" class="custom-select" onchange="updateAccess()" id="availability">
<option value="1" @if (old('availability') != null && old('availability') == 1) selected @endif>Subscription</option>
<option value="0" @if (old('availability') != null && old('availability') == 0) selected @endif>Free</option>
</select>
</div>

resources/views/components/edit/availability-form.blade.php

Open in GitHub
<div class="form-group">
<label for="availability">Availability</label><br>
 
<select name="availability" class="custom-select" onchange="updateAccess()" id="availability">
<option value="1" @if ($content['premium'] == 1) selected @endif>Subscription</option>
<option value="0" @if ($content['premium'] == 0) selected @endif>Free</option>
</select>
</div>

resources/views/episodes/create.blade.php

Open in GitHub
// ...
 
<div class="container">
<div class="row">
<div class="col-lg-12">
<x-availability-form type="create"/>
</div>
</div>
</div>
 
// ...

resources/views/episodes/edit.blade.php

Open in GitHub
// ...
 
<div class="container">
<div class="row">
<div class="col-lg-12">
<x-availability-form type="edit" :content="$content"/>
</div>
</div>
</div>
 
// ...

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.