diff --git a/app/Channel.php b/app/Channel.php new file mode 100644 index 0000000..e095821 --- /dev/null +++ b/app/Channel.php @@ -0,0 +1,45 @@ +color; + } + + public function getRouteKeyName() { + return 'slug'; + } + + public function sluggable() { + return [ + 'slug' => [ + 'source' => 'name' + ] + ]; + } + + public function getSearchResult(): SearchResult { + $url = route('admin.channels.edit', $this); + + return new SearchResult( + $this, + $this->name, + $url + ); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Admin/ChannelController.php b/app/Http/Controllers/Admin/ChannelController.php new file mode 100644 index 0000000..eb97a57 --- /dev/null +++ b/app/Http/Controllers/Admin/ChannelController.php @@ -0,0 +1,106 @@ +authorize('show_channels'); + + $channels = Channel::all(); + + return view('core.channels.index', compact('channels')); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) { + $this->authorize('create_channel'); + + $this->validate(request(), [ + 'name' => ['required'], + 'color' => ['required'], + 'position' => ['required'] + ], [ + 'name.required' => 'The name is required.', + 'color.required' => 'The color is required.', + 'position.required' => 'The position is required.' + ]); + + $channel = Channel::create([ + 'name' => request('name'), + 'color' => '#'.request('color'), + 'position' => request('position') + ]); + + return redirect()->route('admin.channels.edit', $channel)->with('status', 'The channel '.$channel->name.' has been added.'); + } + + /** + * Show the form for editing the specified resource. + * + * @param \App\Channel $channel + * @return \Illuminate\Http\Response + */ + public function edit(Channel $channel) { + $this->authorize('edit_channel'); + + return view('core.channels.edit', compact('channel')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param \App\Channel $channel + * @return \Illuminate\Http\Response + */ + public function update(Request $request, Channel $channel) { + $this->authorize('edit_channel'); + + $this->validate(request(), [ + 'name' => ['required'], + 'color' => ['required'], + 'position' => ['required'] + ], [ + 'name.required' => 'The name is required.', + 'color.required' => 'The color is required.', + 'position.required' => 'The position is required.' + ]); + + $channel->update([ + 'name' => request('name'), + 'color' => '#'.request('color'), + 'position' => request('position') + ]); + + return redirect()->route('admin.channels')->with('status', 'The changes to '.$channel->name.' have been saved.'); + } + + /** + * Remove the specified resource from storage. + * + * @param \App\Channel $channel + * @return \Illuminate\Http\Response + */ + public function destroy(Channel $channel) { + $this->authorize('delete_channel'); + + $channel->delete(); + + return redirect()->route('admin.channels')->with('status', 'The channel '.$channel->name.' has been removed.'); + } +} diff --git a/app/Platform.php b/app/Platform.php index fc80b85..9d69a82 100644 --- a/app/Platform.php +++ b/app/Platform.php @@ -18,14 +18,18 @@ class Platform extends Model implements Searchable { protected $fillable = ['name', 'color', 'icon', 'active', 'slug']; protected $appends = ['plain_icon', 'colored_icon']; - function getPlainIconAttribute() { + public function getPlainIconAttribute() { return ''; } - function getColoredIconAttribute() { + public function getColoredIconAttribute() { return ''; } + public function getBgColorAttribute() { + return 'background-color: #'.$this->color; + } + public function getRouteKeyName() { return 'slug'; } diff --git a/composer.lock b/composer.lock index 9657cd5..3a2ac1f 100644 --- a/composer.lock +++ b/composer.lock @@ -1356,16 +1356,16 @@ }, { "name": "laravel/framework", - "version": "v8.16.1", + "version": "v8.17.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "f7dfc22e6c42e9ed4dda14c05814349af6943206" + "reference": "09bd79531d3f958f02fa34f1f14197b1716ef29b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/f7dfc22e6c42e9ed4dda14c05814349af6943206", - "reference": "f7dfc22e6c42e9ed4dda14c05814349af6943206", + "url": "https://api.github.com/repos/laravel/framework/zipball/09bd79531d3f958f02fa34f1f14197b1716ef29b", + "reference": "09bd79531d3f958f02fa34f1f14197b1716ef29b", "shasum": "" }, "require": { @@ -1515,7 +1515,7 @@ "framework", "laravel" ], - "time": "2020-11-25T15:01:02+00:00" + "time": "2020-12-01T15:01:58+00:00" }, { "name": "laravel/tinker", @@ -3093,16 +3093,16 @@ }, { "name": "symfony/console", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "037b57ac42cafb64b7b55273fe1786f35d623077" + "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/037b57ac42cafb64b7b55273fe1786f35d623077", - "reference": "037b57ac42cafb64b7b55273fe1786f35d623077", + "url": "https://api.github.com/repos/symfony/console/zipball/3e0564fb08d44a98bd5f1960204c958e57bd586b", + "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b", "shasum": "" }, "require": { @@ -3163,6 +3163,12 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -3177,11 +3183,11 @@ "type": "tidelift" } ], - "time": "2020-11-28T10:57:20+00:00" + "time": "2020-11-28T11:24:18+00:00" }, { "name": "symfony/css-selector", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -3307,16 +3313,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "4be32277488607e38ad1108b08ca200882ef6077" + "reference": "289008c5be039e39908d33ae0a8ac99be1210bba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/4be32277488607e38ad1108b08ca200882ef6077", - "reference": "4be32277488607e38ad1108b08ca200882ef6077", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/289008c5be039e39908d33ae0a8ac99be1210bba", + "reference": "289008c5be039e39908d33ae0a8ac99be1210bba", "shasum": "" }, "require": { @@ -3369,20 +3375,20 @@ "type": "tidelift" } ], - "time": "2020-10-28T21:31:18+00:00" + "time": "2020-10-28T21:46:03+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2c660884ec9413455af753515140ce696913693c" + "reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2c660884ec9413455af753515140ce696913693c", - "reference": "2c660884ec9413455af753515140ce696913693c", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/aa13a09811e6d2ad43f8fb336bebdb7691d85d3c", + "reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c", "shasum": "" }, "require": { @@ -3451,7 +3457,7 @@ "type": "tidelift" } ], - "time": "2020-11-01T15:43:26+00:00" + "time": "2020-11-01T16:14:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -3531,7 +3537,7 @@ }, { "name": "symfony/finder", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -3665,16 +3671,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "1e6e9e28369ddd3fd66ca14a469c21ae9b51969a" + "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/1e6e9e28369ddd3fd66ca14a469c21ae9b51969a", - "reference": "1e6e9e28369ddd3fd66ca14a469c21ae9b51969a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e4576271ee99123aa59a40564c7b5405f0ebd1e6", + "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6", "shasum": "" }, "require": { @@ -3731,20 +3737,20 @@ "type": "tidelift" } ], - "time": "2020-11-15T22:55:04+00:00" + "time": "2020-11-27T06:13:25+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "2d0daaf17c9fe14eb3519b94b83d746554ecfd9c" + "reference": "38907e5ccb2d9d371191a946734afc83c7a03160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2d0daaf17c9fe14eb3519b94b83d746554ecfd9c", - "reference": "2d0daaf17c9fe14eb3519b94b83d746554ecfd9c", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/38907e5ccb2d9d371191a946734afc83c7a03160", + "reference": "38907e5ccb2d9d371191a946734afc83c7a03160", "shasum": "" }, "require": { @@ -3764,7 +3770,7 @@ "symfony/cache": "<5.0", "symfony/config": "<5.0", "symfony/console": "<4.4", - "symfony/dependency-injection": "<4.4", + "symfony/dependency-injection": "<5.1.8", "symfony/doctrine-bridge": "<5.0", "symfony/form": "<5.0", "symfony/http-client": "<5.0", @@ -3784,7 +3790,7 @@ "symfony/config": "^5.0", "symfony/console": "^4.4|^5.0", "symfony/css-selector": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", + "symfony/dependency-injection": "^5.1.8", "symfony/dom-crawler": "^4.4|^5.0", "symfony/expression-language": "^4.4|^5.0", "symfony/finder": "^4.4|^5.0", @@ -3840,24 +3846,25 @@ "type": "tidelift" } ], - "time": "2020-11-29T09:27:52+00:00" + "time": "2020-11-30T05:54:18+00:00" }, { "name": "symfony/mime", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "698cab643bbb517a0d9d317e2ec9fc1636e97f1f" + "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/698cab643bbb517a0d9d317e2ec9fc1636e97f1f", - "reference": "698cab643bbb517a0d9d317e2ec9fc1636e97f1f", + "url": "https://api.github.com/repos/symfony/mime/zipball/05f667e8fa029568964fd3bec6bc17765b853cc5", + "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.15" @@ -3867,7 +3874,11 @@ }, "require-dev": { "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "^4.4|^5.0" + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/property-access": "^4.4|^5.1", + "symfony/property-info": "^4.4|^5.1", + "symfony/serializer": "^5.2" }, "type": "library", "autoload": { @@ -3912,7 +3923,7 @@ "type": "tidelift" } ], - "time": "2020-10-28T21:31:18+00:00" + "time": "2020-10-30T14:55:39+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4683,16 +4694,16 @@ }, { "name": "symfony/process", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b25b468538c82f6594058aabaa9bac48d7ef2170" + "reference": "240e74140d4d956265048f3025c0aecbbc302d54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b25b468538c82f6594058aabaa9bac48d7ef2170", - "reference": "b25b468538c82f6594058aabaa9bac48d7ef2170", + "url": "https://api.github.com/repos/symfony/process/zipball/240e74140d4d956265048f3025c0aecbbc302d54", + "reference": "240e74140d4d956265048f3025c0aecbbc302d54", "shasum": "" }, "require": { @@ -4738,20 +4749,20 @@ "type": "tidelift" } ], - "time": "2020-11-02T15:45:32+00:00" + "time": "2020-11-02T15:47:15+00:00" }, { "name": "symfony/routing", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "461b184cfe5c2e677bbd67761aa377914ab48a16" + "reference": "130ac5175ad2fd417978baebd8062e2e6b2bc28b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/461b184cfe5c2e677bbd67761aa377914ab48a16", - "reference": "461b184cfe5c2e677bbd67761aa377914ab48a16", + "url": "https://api.github.com/repos/symfony/routing/zipball/130ac5175ad2fd417978baebd8062e2e6b2bc28b", + "reference": "130ac5175ad2fd417978baebd8062e2e6b2bc28b", "shasum": "" }, "require": { @@ -4765,7 +4776,7 @@ "symfony/yaml": "<4.4" }, "require-dev": { - "doctrine/annotations": "~1.2", + "doctrine/annotations": "^1.7", "psr/log": "~1.0", "symfony/config": "^5.0", "symfony/dependency-injection": "^4.4|^5.0", @@ -4825,7 +4836,7 @@ "type": "tidelift" } ], - "time": "2020-11-26T23:46:31+00:00" + "time": "2020-11-27T00:39:34+00:00" }, { "name": "symfony/service-contracts", @@ -4891,16 +4902,16 @@ }, { "name": "symfony/string", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea" + "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a97573e960303db71be0dd8fda9be3bca5e0feea", - "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea", + "url": "https://api.github.com/repos/symfony/string/zipball/40e975edadd4e32cd16f3753b3bad65d9ac48242", + "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242", "shasum": "" }, "require": { @@ -4967,27 +4978,27 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-24T12:08:07+00:00" }, { "name": "symfony/translation", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "b52e4184a38b69148a2b129c77cf47b8ce61d23f" + "reference": "52f486a707510884450df461b5a6429dd7a67379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b52e4184a38b69148a2b129c77cf47b8ce61d23f", - "reference": "b52e4184a38b69148a2b129c77cf47b8ce61d23f", + "url": "https://api.github.com/repos/symfony/translation/zipball/52f486a707510884450df461b5a6429dd7a67379", + "reference": "52f486a707510884450df461b5a6429dd7a67379", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.15", - "symfony/translation-contracts": "^2" + "symfony/translation-contracts": "^2.3" }, "conflict": { "symfony/config": "<4.4", @@ -5017,6 +5028,9 @@ }, "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { "Symfony\\Component\\Translation\\": "" }, @@ -5054,7 +5068,7 @@ "type": "tidelift" } ], - "time": "2020-11-28T10:57:20+00:00" + "time": "2020-11-28T11:24:18+00:00" }, { "name": "symfony/translation-contracts", @@ -5133,16 +5147,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.1.9", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "006fc2312ee014e1ba46c01185423c010310d00f" + "reference": "173a79c462b1c81e1fa26129f71e41333d846b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/006fc2312ee014e1ba46c01185423c010310d00f", - "reference": "006fc2312ee014e1ba46c01185423c010310d00f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/173a79c462b1c81e1fa26129f71e41333d846b26", + "reference": "173a79c462b1c81e1fa26129f71e41333d846b26", "shasum": "" }, "require": { @@ -5214,7 +5228,7 @@ "type": "tidelift" } ], - "time": "2020-11-26T23:46:31+00:00" + "time": "2020-11-27T00:39:34+00:00" }, { "name": "thujohn/twitter", @@ -5988,16 +6002,16 @@ }, { "name": "phar-io/version", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0" + "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0", + "url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae", + "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae", "shasum": "" }, "require": { @@ -6031,7 +6045,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2020-06-27T14:39:04+00:00" + "time": "2020-11-30T09:21:21+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -6542,16 +6556,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.4.3", + "version": "9.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab" + "reference": "6535e637961f0829832621dc1b7308c2d24a799e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", - "reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6535e637961f0829832621dc1b7308c2d24a799e", + "reference": "6535e637961f0829832621dc1b7308c2d24a799e", "shasum": "" }, "require": { @@ -6637,7 +6651,7 @@ "type": "github" } ], - "time": "2020-11-10T12:53:30+00:00" + "time": "2020-12-01T04:58:47+00:00" }, { "name": "sebastian/cli-parser", diff --git a/database/migrations/2020_12_01_200312_create_channels_table.php b/database/migrations/2020_12_01_200312_create_channels_table.php new file mode 100644 index 0000000..ba2d9bf --- /dev/null +++ b/database/migrations/2020_12_01_200312_create_channels_table.php @@ -0,0 +1,43 @@ +id(); + $table->string('name'); + $table->string('color'); + $table->integer('position'); + $table->string('slug')->unique(); + $table->timestamps(); + }); + + Schema::create('channel_platforms', function (Blueprint $table) { + $table->id(); + $table->foreignId('platform_id')->references('id')->on('platforms'); + $table->foreignId('channel_id')->references('id')->on('channels'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('channel_platforms'); + Schema::dropIfExists('channels'); + } +} diff --git a/database/seeds/RoleTableSeeder.php b/database/seeds/RoleTableSeeder.php index 810dc4f..18cee2a 100644 --- a/database/seeds/RoleTableSeeder.php +++ b/database/seeds/RoleTableSeeder.php @@ -181,6 +181,26 @@ public function run() { 'label' => 'Can remove platform.' ]); + $show_channels = Ability::create([ + 'name' => 'show_channels', + 'label' => 'Can view channels.' + ]); + + $create_channel = Ability::create([ + 'name' => 'create_channel', + 'label' => 'Can create channel.' + ]); + + $edit_channel = Ability::create([ + 'name' => 'edit_channel', + 'label' => 'Can edit channel.' + ]); + + $delete_channel = Ability::create([ + 'name' => 'delete_channel', + 'label' => 'Can remove channel.' + ]); + $edit_settings = Ability::create([ 'name' => 'edit_settings', 'label' => 'Can edit settings.' @@ -221,6 +241,10 @@ public function run() { $admin->abilities()->attach($create_platform); $admin->abilities()->attach($edit_platform); $admin->abilities()->attach($delete_platform); + $admin->abilities()->attach($show_channels); + $admin->abilities()->attach($create_channel); + $admin->abilities()->attach($edit_channel); + $admin->abilities()->attach($delete_channel); $editor->abilities()->attach($view_backstage->id); $editor->abilities()->attach($show_users->id); @@ -239,5 +263,7 @@ public function run() { $editor->abilities()->attach($edit_log); $editor->abilities()->attach($show_platforms); $editor->abilities()->attach($edit_platform); + $editor->abilities()->attach($show_channels); + $editor->abilities()->attach($edit_channel); } } diff --git a/readme.md b/readme.md index 2d0b0d5..4bfbac7 100644 --- a/readme.md +++ b/readme.md @@ -99,4 +99,10 @@ alter table `platforms` add unique `platforms_slug_unique`(`slug`); create table `milestone_platforms` (`id` bigint unsigned not null auto_increment primary key, `platform_id` bigint unsigned not null, `milestone_id` bigint unsigned not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'; alter table `milestone_platforms` add constraint `milestone_platforms_platform_id_foreign` foreign key (`platform_id`) references `platforms` (`id`); alter table `milestone_platforms` add constraint `milestone_platforms_milestone_id_foreign` foreign key (`milestone_id`) references `milestones` (`id`); + +create table `channels` (`id` bigint unsigned not null auto_increment primary key, `name` varchar(191) not null, `color` varchar(191) not null, `position` int not null, `slug` varchar(191) not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'; +alter table `channels` add unique `channels_slug_unique`(`slug`); +create table `channel_platforms` (`id` bigint unsigned not null auto_increment primary key, `platform_id` bigint unsigned not null, `channel_id` bigint unsigned not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'; +alter table `channel_platforms` add constraint `channel_platforms_platform_id_foreign` foreign key (`platform_id`) references `platforms` (`id`); +alter table `channel_platforms` add constraint `channel_platforms_channel_id_foreign` foreign key (`channel_id`) references `channels` (`id`); ``` \ No newline at end of file diff --git a/resources/views/core/channels/edit.blade.php b/resources/views/core/channels/edit.blade.php new file mode 100644 index 0000000..e18b99f --- /dev/null +++ b/resources/views/core/channels/edit.blade.php @@ -0,0 +1,82 @@ +@extends('core.layouts.app') +@section('title') {{ $channel->name }} · Channels @endsection + +@section('content') +
+{!! session('status') !!}
+{!! session('status') !!}
+Create one to get started!
+