39 lines
1.5 KiB
PHP
39 lines
1.5 KiB
PHP
@extends('layouts.admin_layout')
|
|
@section('content')
|
|
<div class="container">
|
|
<h2>Новости</h2>
|
|
<br>
|
|
<a href="{{ route('news.create') }}" class="btn btn-primary">Создать Новость</a>
|
|
<br>
|
|
<br>
|
|
<table class="table">
|
|
<thead class="border-b-2 border-solid border-black text-left" style="text-align: left">
|
|
<tr>
|
|
<th scope="col">Название</th>
|
|
<th scope="col">Текст</th>
|
|
<th scope="col">Действия</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($news as $item)
|
|
<tr class="">
|
|
<td><a href="{{ route('news.show', $item) }}">{{ $item->name }}</a></td>
|
|
<td>{{ Str::words($item->text, 10, '...') }}</td>
|
|
<td><a href="{{ route("news.edit", $item) }}"
|
|
class="btn btn-secondary">редактировать</a>
|
|
<a rel="nofollow" data-method="delete" data-confirm="Вы действительно хотите удалить?"
|
|
href="{{ route('news.destroy', $item) }}"
|
|
class="btn btn-danger">
|
|
удалить
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
<br>
|
|
<br>
|
|
</div>
|
|
|
|
@endsection
|