diff --git a/src/resources/views/columns/video.blade.php b/src/resources/views/columns/video.blade.php new file mode 100644 index 0000000000..ed2bead9bc --- /dev/null +++ b/src/resources/views/columns/video.blade.php @@ -0,0 +1,24 @@ +{{-- regular object attribute --}} +@php + if( !empty($entry->{$column['name']}) ) { + + // if attribute casting is used, convert to object + if (is_array($entry->{$column['name']})) { + $video = (object)$entry->{$column['name']}; + } elseif (is_string($entry->{$column['name']})) { + $video = json_decode($entry->{$column['name']}); + } else { + $video = $entry->{$column['name']}; + } + $bgColor = $video->provider == 'vimeo' ? '#00ADEF' : '#DA2724'; + } +@endphp + + @if( isset($video) ) + + + {{$video->title}} + @else + - + @endif + diff --git a/src/resources/views/fields/video.blade.php b/src/resources/views/fields/video.blade.php new file mode 100644 index 0000000000..cc90c6fa39 --- /dev/null +++ b/src/resources/views/fields/video.blade.php @@ -0,0 +1,350 @@ + + + + +
+ + +
+ 'video-link form-control']) type="text" name="{{ $field['name'] }}_link" id="{{ $field['name'] }}_link"> +
+
+ + +
+ +
+
+ + {{-- HINT --}} + @if (isset($field['hint'])) +

{!! $field['hint'] !!}

+ @endif +
+ +{{-- ########################################## --}} +{{-- Extra CSS and JS for this particular field --}} +{{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} +@if ($crud->checkIfFieldIsFirstOfItsType($field, $fields)) + + {{-- FIELD CSS - will be loaded in the after_styles section --}} + @push('crud_fields_styles') + {{-- @push('crud_fields_styles') + {{-- YOUR CSS HERE --}} + + @endpush + + {{-- FIELD JS - will be loaded in the after_scripts section --}} + @push('crud_fields_scripts') + {{-- YOUR JS HERE --}} + + + @endpush +@endif +{{-- End of Extra CSS and JS --}} +{{-- ########################################## --}}