-
app/View/Components/AvailabilityForm.php
Open in GitHubuse 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> // ...