Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/imrjat/basic-crud
Browse files Browse the repository at this point in the history
  • Loading branch information
imrjat committed Dec 12, 2023
2 parents 7cfd65f + fc6f9e9 commit 1ed20d4
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 68 deletions.
120 changes: 59 additions & 61 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions resources/views/posts/_form.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use('App\Enums\FeaturedStatus')
<div class="form-group mt-2">
<label for="title">Title</label>
<input id="title" class="form-control" type="text" name="title"
Expand Down Expand Up @@ -45,12 +46,12 @@

<div class="form-group mt-2">
<label for="is_featured">Is Featured</label>
@foreach (App\Enums\FeaturedStatus::cases() as $featuredStatus)
<div class="form-check mt-2">
<input id="is_featured_{{$featuredStatus->name}}" class="form-check-input" type="radio" name="is_featured" value="{{$featuredStatus->value}}"
@checked(old('is_featured', $post->is_featured->value ?? null) == $featuredStatus->value)>
<label for="is_featured_{{$featuredStatus->name}}">{{$featuredStatus->label()}}</label>
</div>
@foreach (FeaturedStatus::cases() as $featuredStatus)
<div class="form-check mt-2">
<input id="is_featured_{{ $featuredStatus->name }}" class="form-check-input" type="radio"
name="is_featured" value="{{ $featuredStatus->value }}" @checked(old('is_featured', $post->is_featured->value ?? null) == $featuredStatus->value)>
<label for="is_featured_{{ $featuredStatus->name }}">{{ $featuredStatus->label() }}</label>
</div>
@endforeach
</div>

Expand Down
3 changes: 2 additions & 1 deletion resources/views/posts/show.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use('App\Enums\FeaturedStatus')
@extends('layouts.app')
@section('title', $post->title)
@section('content')
Expand Down Expand Up @@ -33,7 +34,7 @@
@endforeach
</div>
<div>
@if ($post->is_featured === App\Enums\FeaturedStatus::FEATURED)
@if ($post->is_featured === FeaturedStatus::FEATURED)
<span class="badge bg-success">Featured</span>
@else
<span class="badge bg-info">Not Featured</span>
Expand Down
Loading

0 comments on commit 1ed20d4

Please sign in to comment.