Creo que termine con el admin del post

This commit is contained in:
Daniel Cortés
2019-06-23 20:12:37 -04:00
parent 8753ad62e7
commit 08f6e9a0ab
8 changed files with 82 additions and 12 deletions

View File

@@ -15,7 +15,7 @@
<label for="md">Contenido</label>
<textarea id="md" name="md"></textarea>
</div>
<input type="submit" value="Crear"/>
<input type="submit" class="button" value="Crear"/>
</form>
@endsection

View File

@@ -0,0 +1,20 @@
@extends('admin.base')
@section('title')
<h1>Edit Post</h1>
@endsection
@section('content')
<form action="{{ route('admin.post.update', ['post' => $post->id]) }}" method="post">
@csrf
<div>
<label for="title">Titulo</label>
<input type="text" id="title" name="title" value="{{ old('title', $post->title) }}" required/>
</div>
<div>
<label for="md">Contenido</label>
<textarea id="md" name="md">{{ old('md', $post->md) }}</textarea>
</div>
<input type="submit" class="button" value="Actualizar"/>
</form>
@endsection

View File

@@ -21,8 +21,11 @@
<td>{{$post->title}}</td>
<td>{{$post->created_at->format('Y-m-d')}}</td>
<td class="controls">
<a href="#">edit</a>
<a href="#">delete</a>
<a href="{{ route('admin.post.edit', ['post' => $post->id]) }}">edit</a>
<form action={{ route('admin.post.delete', ['post' => $post->id]) }} method="post">
@csrf
<input type="submit" value="delete"/>
</form>
</td>
</tr>
@endforeach