diff --git a/app/Http/Controllers/PlatformChannelsController.php b/app/Http/Controllers/PlatformChannelsController.php index 24c8772..364301c 100644 --- a/app/Http/Controllers/PlatformChannelsController.php +++ b/app/Http/Controllers/PlatformChannelsController.php @@ -61,6 +61,13 @@ public function store(Request $request): RedirectResponse ->with('success', 'Channel created successfully!'); } + public function show(PlatformChannel $channel): View + { + $channel->load(['platformInstance', 'feeds']); + + return ViewFacade::make('pages.channels.show', compact('channel')); + } + public function edit(PlatformChannel $channel): View { $instances = PlatformInstance::where('is_active', true) @@ -95,4 +102,15 @@ public function destroy(PlatformChannel $channel): RedirectResponse return redirect()->route('channels.index') ->with('success', 'Channel deleted successfully!'); } + + public function toggle(PlatformChannel $channel): RedirectResponse + { + $newStatus = !$channel->is_active; + $channel->update(['is_active' => $newStatus]); + + $status = $newStatus ? 'activated' : 'deactivated'; + + return redirect()->route('channels.index') + ->with('success', "Channel {$status} successfully!"); + } } \ No newline at end of file diff --git a/resources/views/pages/channels/create.blade.php b/resources/views/pages/channels/create.blade.php new file mode 100644 index 0000000..0e18bc7 --- /dev/null +++ b/resources/views/pages/channels/create.blade.php @@ -0,0 +1,100 @@ +@extends('layouts.app') + +@section('content') +
Add a new publishing channel to your platform
+Update channel details
+Manage channels for publishing content
+{{ $channel->platformInstance->name }} Channel
+Enable or disable publishing to this channel
+
+
Feeds that route content to this channel
+{{ $feed->name }}
+{{ $feed->url }}
+This channel doesn't have any feeds routing content to it yet.
+ + Create Route + +