Cree las rutas para la creacion de projectos

This commit is contained in:
Daniel Cortés
2019-07-03 01:28:51 -04:00
parent b15c2dc658
commit 53b709c175
22 changed files with 491 additions and 17 deletions

View File

@@ -0,0 +1,26 @@
@extends('admin.base')
@section('title')
<h1>Create Project</h1>
@endsection
@section('content')
<form action="{{ route('admin.project.save') }}" enctype="multipart/form-data" method="post">
@csrf
<div>
<label for="title">Titulo</label>
<input type="text" class="form-input" id="title" name="title" required/>
</div>
<div>
<label for="md">Descripcion</label>
<textarea id="md" class="form-input" name="md"></textarea>
</div>
<div>
<label for="photos">Fotos</label>
<input multiple="multiple" id="photos" class="form-input" name="photos[]" type="file">
</div>
<input type="submit" class="form-submit" value="Crear"/>
</form>
@endsection

View File

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

View File

@@ -0,0 +1,32 @@
@extends('admin.base')
@section('title')
<h1>Projects</h1>
@endsection
@section('content')
<table class="table">
<thead>
<tr>
<th>Titulo</th>
<th class="controls"><a href="{{ route('admin.project.create') }}">create</a></th>
</tr>
</thead>
<tbody>
@foreach($projects as $project)
<tr>
<td>{{$project->title}}</td>
<td class="controls">
<a href="{{ route('admin.project.edit', ['project' => $project->id]) }}">edit</a>
<form action={{ route('admin.project.delete', ['project' => $project->id]) }} method="post">
@csrf
<input type="submit" value="delete"/>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
@endsection