diff --git a/app/Http/Controllers/JoinedController.php b/app/Http/Controllers/JoinedController.php index be3274e..3f38697 100644 --- a/app/Http/Controllers/JoinedController.php +++ b/app/Http/Controllers/JoinedController.php @@ -9,55 +9,46 @@ class JoinedController extends Controller { - public function __construct() - { - $this->authorizeResource(Joined::class, 'joined'); - } + public function __construct() + { + $this->authorizeResource(Joined::class, 'joined'); + } public function index() { - $collective = auth_collective(); return view('admin.joined.index'); } public function create() { - return view('admin.joined.create')->with([ - 'categories' => Category::all(), - ]); + return view('admin.joined.create'); } public function store(StoreJoinedRequest $request) { $validated = $request->safe()->only([ - 'categories', - 'url', - 'subject', - 'image', - 'approved', - ]); + 'categories', + 'url', + 'subject', + 'image', + 'approved', + ]); - Joined::store($validated); - return redirect()->route('admin.joined.index')->with('success', 'Fanlisting added.'); - } + Joined::store($validated); - public function show(Joined $joined) - { - // + return redirect()->route('admin.joined.index')->with('success', 'Fanlisting added.'); } public function edit(Joined $joined) { - // + return view('admin.joined.edit')->with('joined', $joined); } public function update(UpdateJoinedRequest $request, Joined $joined) { - // } public function destroy(Joined $joined) { - // } } diff --git a/public/css/admin/style.css b/public/css/admin/style.css index 9903cf3..0ee1c5b 100644 --- a/public/css/admin/style.css +++ b/public/css/admin/style.css @@ -68,7 +68,7 @@ html { body { font-family: "Imprima", sans-serif; - font-size: 16px; + font-size: 14px; background: rgb(243, 200, 255); background: linear-gradient(320deg, rgb(243, 200, 255) 0%, rgb(191, 191, 255) 100%); } @@ -84,7 +84,7 @@ a:hover { h1 { font-family: "Satisfy", serif; - font-size: 46px; + font-size: 44px; font-weight: normal; margin-left: 40px; margin-bottom: 10px; diff --git a/resources/sass/admin/_vars.scss b/resources/sass/admin/_vars.scss index d030df8..9935e5f 100644 --- a/resources/sass/admin/_vars.scss +++ b/resources/sass/admin/_vars.scss @@ -3,7 +3,7 @@ $f-main: 'Imprima', sans-serif; $f-title: 'Satisfy', serif; -$f-size: 16px; +$f-size: 14px; $c-main: #7874ff; $c-main-light: color.scale($c-main, $lightness: 70%); diff --git a/resources/views/admin/joined/create.blade.php b/resources/views/admin/joined/create.blade.php index f7409fa..2300909 100644 --- a/resources/views/admin/joined/create.blade.php +++ b/resources/views/admin/joined/create.blade.php @@ -13,35 +13,13 @@ @csrf
- - - @error('categories')

{{ $message }}

@enderror + + + + + - - - @error('url')

{{ $message }}

@enderror - - - - @error('subject')

{{ $message }}

@enderror - - - - @error('image')

{{ $message }}

@enderror - -
- - -
- -
- - -
+
diff --git a/resources/views/admin/joined/edit.blade.php b/resources/views/admin/joined/edit.blade.php new file mode 100644 index 0000000..553eff3 --- /dev/null +++ b/resources/views/admin/joined/edit.blade.php @@ -0,0 +1,27 @@ +@extends('admin.layout') + +@section('pg-nav') + +@endsection + +@section('pg-title', 'Edit Joined') + +@section('content') + +
+ @csrf + @method('PATCH') + +
+ + + + + + + +
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/components/admin/form/categories.blade.php b/resources/views/components/admin/form/categories.blade.php index 89e7ec8..339d3d5 100644 --- a/resources/views/components/admin/form/categories.blade.php +++ b/resources/views/components/admin/form/categories.blade.php @@ -1,21 +1,33 @@ {{-- expected attributes: name, id --}} -@props(['categories', 'prevCats' => false]) +@props([ + 'prevCats' => false, + 'labelClass' => '', + 'selectClass' => '', + 'errorClass' => '', + ]) @php + use App\Models\Category; + $categories = Category::all(); + + $id = rtrim($attributes['name'], '[]'); + $selected = null; $name = rtrim($attributes['name'], '[]'); if (old($name) != null) { $selected = collect(old($name)); } else if ($prevCats) { - $selected = $prevCats; + $selected = $prevCats->pluck('id'); } @endphp - @foreach ($categories as $cat) @endforeach - \ No newline at end of file + +@error($attributes['name'])

{{ $message }}

@enderror \ No newline at end of file diff --git a/resources/views/components/form/buttons.blade.php b/resources/views/components/form/buttons.blade.php new file mode 100644 index 0000000..75e7f09 --- /dev/null +++ b/resources/views/components/form/buttons.blade.php @@ -0,0 +1,15 @@ +@props([ + 'divClass' => '', + 'submitClass' => '', + 'resetClass' => '', + 'btnClass' => '', + 'submitValue' => 'Submit', + 'resetValue' => 'Reset', +]) + +
+ + +
\ No newline at end of file diff --git a/resources/views/components/form/checkbox.blade.php b/resources/views/components/form/checkbox.blade.php new file mode 100644 index 0000000..da2011c --- /dev/null +++ b/resources/views/components/form/checkbox.blade.php @@ -0,0 +1,20 @@ +{{-- expected attributes: name --}} + +@props([ + 'divClass' => '', + 'value' => '1', + 'inputClass' => '', + 'current' => null, + 'labelClass' => '', + 'label' +]) + +
+ + +
\ No newline at end of file diff --git a/resources/views/components/form/file.blade.php b/resources/views/components/form/file.blade.php new file mode 100644 index 0000000..ad1d802 --- /dev/null +++ b/resources/views/components/form/file.blade.php @@ -0,0 +1,15 @@ +@props([ + 'labelClass' => '', + 'label' => 'Image:', + 'accept' => 'image', + 'inputClass' => '', + 'formClass' => '', +]) + + + +@error($attributes['name'])

{{ $message }}

@enderror \ No newline at end of file diff --git a/resources/views/components/form/text.blade.php b/resources/views/components/form/text.blade.php new file mode 100644 index 0000000..d82c738 --- /dev/null +++ b/resources/views/components/form/text.blade.php @@ -0,0 +1,15 @@ +{{-- expected attributes: name --}} +@props([ + 'labelClass' => '', + 'label', + 'current' => null, + 'inputClass' => '', + 'errorClass' => '', +]) + + + +@error($attributes['name'])

{{ $message }}

@enderror \ No newline at end of file diff --git a/resources/views/components/form/url.blade.php b/resources/views/components/form/url.blade.php new file mode 100644 index 0000000..bd4dabb --- /dev/null +++ b/resources/views/components/form/url.blade.php @@ -0,0 +1,15 @@ +{{-- expected attributes: name --}} + +@props([ + 'labelClass' => '', + 'label' => 'URL:', + 'current' => null, + 'inputClass' => '', + 'errorClass' => '' +]) + + + +@error($attributes['name'])

{{ $message }}

@enderror \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index e0be7ef..a8905ba 100644 --- a/routes/web.php +++ b/routes/web.php @@ -38,8 +38,6 @@ ->name('admin.joined.create'); Route::post('/fanatic/joined', [JoinedController::class, 'store']) ->name('admin.joined.store'); - Route::get('/fanatic/joined/{joined}', [JoinedController::class, 'show']) - ->name('admin.joined.show'); Route::get('/fanatic/joined/{joined}/edit', [JoinedController::class, 'edit']) ->name('admin.joined.edit'); Route::patch('/fanatic/joined/{joined}', [JoinedController::class, 'update'])