ferdysetia_aan

TK3 - No.1 - edit.blade.php

Jul 26th, 2025
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.76 KB | None | 0 0
  1. @extends('layouts.app')
  2.  
  3. @section('content')
  4.     <div class="container">
  5.         <div class="news-article">
  6.             <h1>Edit Berita</h1>
  7.             <form action="{{ route('berita.update', $berita->id_berita) }}" method="POST">
  8.                 @csrf
  9.                 @method('PUT')
  10.                 <div class="form-group">
  11.                     <label for="judul">Judul</label>
  12.                     <input type="text" name="judul" id="judul" class="form-control" value="{{ $berita->judul }}" required>
  13.                 </div>
  14.                 <div class="form-group">
  15.                     <label for="konten">Konten</label>
  16.                     <textarea name="konten" id="konten" class="form-control" required>{{ $berita->konten }}</textarea>
  17.                 </div>
  18.                 <button type="submit" class="btn btn-primary">Simpan Perubahan</button>
  19.             </form>
  20.         </div>
  21.     </div>
  22. @endsection
  23.  
  24. @section('css')
  25.     <style>
  26.         .container {
  27.             width: 90%;
  28.             max-width: 960px;
  29.             margin: 0 auto;
  30.         }
  31.  
  32.         .news-article {
  33.             background-color: #ffffff;
  34.            padding: 30px;
  35.             border-radius: 8px;
  36.             box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  37.             margin-bottom: 30px;
  38.         }
  39.  
  40.         h1 {
  41.             font-size: 2.5rem;
  42.             font-weight: bold;
  43.             margin-bottom: 15px;
  44.             color: #333;
  45.        }
  46.  
  47.         .form-group {
  48.             margin-bottom: 20px;
  49.         }
  50.  
  51.         label {
  52.             font-weight: bold;
  53.             margin-bottom: 8px;
  54.             color: #333;
  55.        }
  56.  
  57.         .form-control {
  58.             width: 100%;
  59.             padding: 12px;
  60.             border-radius: 5px;
  61.             border: 1px solid #ddd;
  62.            box-sizing: border-box;
  63.             font-size: 1rem;
  64.             color: #333;
  65.        }
  66.  
  67.         textarea.form-control {
  68.             resize: vertical;
  69.             height: 180px;
  70.         }
  71.  
  72.         button.btn {
  73.             padding: 12px 20px;
  74.             font-size: 16px;
  75.             text-align: center;
  76.             border-radius: 5px;
  77.             border: none;
  78.             background-color: #007bff;
  79.            color: white;
  80.             cursor: pointer;
  81.             margin-top: 20px;
  82.         }
  83.  
  84.         button.btn:hover {
  85.             background-color: #0056b3;
  86.        }
  87.  
  88.         /* Responsive Design */
  89.         @media (max-width: 768px) {
  90.             .news-article {
  91.                 padding: 20px;
  92.             }
  93.  
  94.             h1 {
  95.                 font-size: 2rem;
  96.             }
  97.  
  98.             .form-control {
  99.                 font-size: 0.95rem;
  100.             }
  101.  
  102.             button.btn {
  103.                 width: 100%;
  104.             }
  105.         }
  106.     </style>
  107. @endsection
  108.  
Advertisement
Add Comment
Please, Sign In to add comment