Created
February 22, 2020 08:17
-
-
Save rizkhal/40bb97f617ba846b9e8708f557c39662 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.master') | |
@push('heading') | |
@component('components.heading') | |
Edit Post | |
@endcomponent | |
@endpush | |
@push('button') | |
@component('components.button') | |
@slot('url') | |
{{ route('posts.index') }} | |
@endslot | |
@slot('text') | |
All Post | |
@endslot | |
@endcomponent | |
@endpush | |
@section('body') | |
<form action="{{ route('posts.store') }}" method="post" id="form-box" class="p-2"> | |
@csrf | |
@if ($errors->has('title')) | |
<div class="text-danger">{{$errors->first('title')}}</div> | |
@endif | |
<div class="form-group input-group"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text"><i class="fas fa-at"></i></span> | |
</div> | |
<input type="text" value="{{old('title', $post->title)}}" name="title" class="form-control" placeholder="Input title"> | |
</div> | |
@if ($errors->has('body')) | |
<div class="text-danger">{{$errors->first('body')}}</div> | |
@endif | |
<div class="form-group input-group"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text"><i class="fas fa-edit"></i></span> | |
</div> | |
<textarea name="body" id="body" class="form-control" placeholder="Write your post" cols="30" rows="4">{{ old('body', $post->title) }}</textarea> | |
</div> | |
<div class="form-group"> | |
<input type="submit" name="submit" id="submit" class="btn btn-primary btn-block" value="Save"> | |
</div> | |
</form> | |
@endsection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment