100 lines
6 KiB
PHP
100 lines
6 KiB
PHP
|
|
@extends('layouts.app')
|
||
|
|
|
||
|
|
@section('content')
|
||
|
|
<div class="max-w-2xl mx-auto py-6 sm:px-6 lg:px-8">
|
||
|
|
<div class="px-4 py-6 sm:px-0">
|
||
|
|
<div class="mb-6">
|
||
|
|
<h1 class="text-2xl font-semibold text-gray-900">Create New Channel</h1>
|
||
|
|
<p class="mt-1 text-sm text-gray-600">Add a new publishing channel to your platform</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="bg-white shadow sm:rounded-lg">
|
||
|
|
<form action="{{ route('channels.store') }}" method="POST" class="px-4 py-5 sm:p-6">
|
||
|
|
@csrf
|
||
|
|
|
||
|
|
<div class="grid grid-cols-1 gap-6">
|
||
|
|
<div>
|
||
|
|
<label for="platform_instance_id" class="block text-sm font-medium text-gray-700">Platform</label>
|
||
|
|
<select name="platform_instance_id" id="platform_instance_id" required
|
||
|
|
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('platform_instance_id') border-red-300 @enderror">
|
||
|
|
<option value="">Select a platform</option>
|
||
|
|
@foreach($instances as $instance)
|
||
|
|
<option value="{{ $instance->id }}" {{ old('platform_instance_id') == $instance->id ? 'selected' : '' }}>
|
||
|
|
{{ $instance->name }}
|
||
|
|
</option>
|
||
|
|
@endforeach
|
||
|
|
</select>
|
||
|
|
@error('platform_instance_id')
|
||
|
|
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||
|
|
@enderror
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div>
|
||
|
|
<label for="name" class="block text-sm font-medium text-gray-700">Channel Name</label>
|
||
|
|
<input type="text" name="name" id="name" required
|
||
|
|
value="{{ old('name') }}"
|
||
|
|
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('name') border-red-300 @enderror"
|
||
|
|
placeholder="technology">
|
||
|
|
<p class="mt-1 text-sm text-gray-500">The channel identifier (e.g., "technology", "news")</p>
|
||
|
|
@error('name')
|
||
|
|
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||
|
|
@enderror
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div>
|
||
|
|
<label for="display_name" class="block text-sm font-medium text-gray-700">Display Name</label>
|
||
|
|
<input type="text" name="display_name" id="display_name"
|
||
|
|
value="{{ old('display_name') }}"
|
||
|
|
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('display_name') border-red-300 @enderror"
|
||
|
|
placeholder="Technology">
|
||
|
|
<p class="mt-1 text-sm text-gray-500">Human-readable name for the channel (optional)</p>
|
||
|
|
@error('display_name')
|
||
|
|
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||
|
|
@enderror
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div>
|
||
|
|
<label for="channel_id" class="block text-sm font-medium text-gray-700">Channel ID</label>
|
||
|
|
<input type="text" name="channel_id" id="channel_id"
|
||
|
|
value="{{ old('channel_id') }}"
|
||
|
|
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('channel_id') border-red-300 @enderror"
|
||
|
|
placeholder="12345">
|
||
|
|
<p class="mt-1 text-sm text-gray-500">Platform-specific channel ID (optional)</p>
|
||
|
|
@error('channel_id')
|
||
|
|
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||
|
|
@enderror
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div>
|
||
|
|
<label for="description" class="block text-sm font-medium text-gray-700">Description</label>
|
||
|
|
<textarea name="description" id="description" rows="3"
|
||
|
|
class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm @error('description') border-red-300 @enderror"
|
||
|
|
placeholder="Channel for technology-related content">{{ old('description') }}</textarea>
|
||
|
|
@error('description')
|
||
|
|
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
|
||
|
|
@enderror
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="flex items-center">
|
||
|
|
<input type="checkbox" name="is_active" id="is_active" value="1"
|
||
|
|
{{ old('is_active', true) ? 'checked' : '' }}
|
||
|
|
class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
|
||
|
|
<label for="is_active" class="ml-2 block text-sm text-gray-900">
|
||
|
|
Active (channel can receive published content)
|
||
|
|
</label>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="mt-6 flex items-center justify-end space-x-3">
|
||
|
|
<a href="{{ route('channels.index') }}" class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50">
|
||
|
|
Cancel
|
||
|
|
</a>
|
||
|
|
<button type="submit" class="bg-indigo-600 py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white hover:bg-indigo-700">
|
||
|
|
Create Channel
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
@endsection
|