64 lines
3.9 KiB
PHP
64 lines
3.9 KiB
PHP
<x-app-layout>
|
|
<div class="basis-0 ms-16 mt-2 me-16 justify-center">
|
|
<form method="POST" action="{{ route('recetas.store')}}">
|
|
@csrf
|
|
<textarea name="title" placeholder = "{{__('titulo')}}"
|
|
class="block w-full border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm"
|
|
>{{old('title')}}</textarea>
|
|
<textarea name="message" placeholder ="{{ __('escriba aquí')}}"
|
|
class="mt-2 block w-full border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm"
|
|
>{{old('message')}}</textarea>
|
|
<x-input-error :messages="$errors->get('message')" class="mt-2" />
|
|
<x-primary-button class="mt-4">{{ __('Publicar Receta') }}</x-primary-button>
|
|
</form>
|
|
<hr class="mt-4">
|
|
<div class="mt-4 bg-white shadow-sm rounded-lg divide-y">
|
|
@foreach ($recetas as $receta)
|
|
<div class="p-6 flex space-x-2">
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-gray-600 -scale-x-100" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" />
|
|
</svg>
|
|
|
|
<div class="flex-1">
|
|
<div class="flex justify-between items-center">
|
|
<div>
|
|
<span class="text-gray-800">{{ $receta->user->name }}</span>
|
|
<small class="ml-2 text-sm text-gray-600">{{ $receta->created_at->format('j M Y, g:i a') }}</small>
|
|
@unless ($receta->created_at->eq($receta->updated_at))
|
|
<small class="text-sm text-gray-600"> · {{ __('edited') }}</small>
|
|
@endunless
|
|
</div>
|
|
@if ($receta->user->is(auth()->user()))
|
|
<x-dropdown>
|
|
<x-slot name="trigger">
|
|
<button>
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-gray-400" viewBox="0 0 20 20" fill="currentColor">
|
|
<path d="M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z" />
|
|
</svg>
|
|
</button>
|
|
</x-slot>
|
|
<x-slot name="content">
|
|
<x-dropdown-link :href="route('recetas.edit', $receta)">
|
|
{{ __('Edit') }}
|
|
</x-dropdown-link>
|
|
<form method="POST" action="{{ route('recetas.destroy', $receta) }}">
|
|
@csrf
|
|
@method('delete')
|
|
<x-dropdown-link :href="route('recetas.destroy', $receta)" onclick="event.preventDefault(); this.closest('form').submit();">
|
|
{{ __('Delete') }}
|
|
</x-dropdown-link>
|
|
|
|
</form>
|
|
</x-slot>
|
|
</x-dropdown>
|
|
@endif
|
|
</div>
|
|
<p class="mt-3 text-lg text-gray-500">{{$receta->title}}</p>
|
|
<p class="mt-2 text-lg text-gray-900">{{ $receta->message }}</p>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|