uff creo que ya esta
This commit is contained in:
@@ -5,21 +5,23 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form class="pure-form pure-form-stacked" action="{{ route('admin.post.save') }}" method="post">
|
||||
@csrf
|
||||
<fieldset>
|
||||
<h1>Create Post</h1>
|
||||
<a class="pure-button button-black-white" href="{{ route('admin.post.index') }}">Back</a>
|
||||
<article>
|
||||
<form class="pure-form pure-form-stacked" action="{{ route('admin.post.save') }}" method="post">
|
||||
@csrf
|
||||
<fieldset>
|
||||
<h1>Create Post</h1>
|
||||
<a class="pure-button button-black-white" href="{{ route('admin.post.index') }}">Back</a>
|
||||
|
||||
<label for="title">Title</label>
|
||||
<input type="text" id="title" name="title" required/>
|
||||
<label for="title">Title</label>
|
||||
<input type="text" id="title" name="title" required/>
|
||||
|
||||
<label for="md">Content</label>
|
||||
<textarea id="md" name="md"></textarea>
|
||||
<label for="md">Content</label>
|
||||
<textarea id="md" name="md"></textarea>
|
||||
|
||||
<div class="control">
|
||||
<button class="pure-button button-black-white" type="submit">Create</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="control">
|
||||
<button class="pure-button button-black-white" type="submit">Create</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</article>
|
||||
@endsection
|
||||
|
||||
@@ -5,21 +5,23 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<form class="pure-form pure-form-stacked" action="{{ route('admin.post.update', ['post' => $post->id]) }}" method="post">
|
||||
@csrf
|
||||
<fieldset>
|
||||
<h1>Editar Post</h1>
|
||||
<a href="{{ route('admin.post.index') }}" class="pure-button button-black-white">Back</a>
|
||||
<article>
|
||||
<form class="pure-form pure-form-stacked" action="{{ route('admin.post.update', ['post' => $post->id]) }}" method="post">
|
||||
@csrf
|
||||
<fieldset>
|
||||
<h1>Editar Post</h1>
|
||||
<a href="{{ route('admin.post.index') }}" class="pure-button button-black-white">Back</a>
|
||||
|
||||
<label for="title">Title</label>
|
||||
<input type="text" id="title" name="title" value="{{ old('title', $post->title) }}" required/>
|
||||
<label for="title">Title</label>
|
||||
<input type="text" id="title" name="title" value="{{ old('title', $post->title) }}" required/>
|
||||
|
||||
<label for="md">Content</label>
|
||||
<textarea id="md" name="md">{{ old('md', $post->md) }}</textarea>
|
||||
<label for="md">Content</label>
|
||||
<textarea id="md" name="md">{{ old('md', $post->md) }}</textarea>
|
||||
|
||||
<div class="control">
|
||||
<button type="submit" class="pure-button button-black-white">Update</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="control">
|
||||
<button type="submit" class="pure-button button-black-white">Update</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</article>
|
||||
@endsection
|
||||
|
||||
@@ -1,36 +1,35 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="table-heading">
|
||||
<article>
|
||||
<h1>Posts</h1>
|
||||
<a class="pure-button button-black-white" href="{{ route('admin.post.create') }}">Create Post</a>
|
||||
</div>
|
||||
|
||||
<table class="pure-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Title</th>
|
||||
<th>Date</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($posts as $post)
|
||||
<table class="pure-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{$post->id}}</td>
|
||||
<td>{{ Str::limit($post->title, 30, "...") }}</td>
|
||||
<td>{{$post->created_at->format('Y-m-d')}}</td>
|
||||
<td class="controls">
|
||||
<a href="{{ route('admin.post.edit', ['post' => $post->id]) }}" class="pure-button button-black-white">Edit</a>
|
||||
<form action={{ route('admin.post.delete', ['post' => $post->id]) }} method="post">
|
||||
@csrf
|
||||
<button type="submit" class="pure-button button-black-white" onclick="return confirm('Estas seguro?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
<th>Id</th>
|
||||
<th>Title</th>
|
||||
<th>Date</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($posts as $post)
|
||||
<tr>
|
||||
<td>{{$post->id}}</td>
|
||||
<td>{{ Str::limit($post->title, 30, "...") }}</td>
|
||||
<td>{{$post->created_at->format('Y-m-d')}}</td>
|
||||
<td class="controls">
|
||||
<a href="{{ route('admin.post.edit', ['post' => $post->id]) }}" class="pure-button button-black-white">Edit</a>
|
||||
<form action={{ route('admin.post.delete', ['post' => $post->id]) }} method="post">
|
||||
@csrf
|
||||
<button type="submit" class="pure-button button-black-white" onclick="return confirm('Estas seguro?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user