From 710f54c0156c5fa081bc6af1a68e7cb44723939b Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 24 Jan 2022 19:34:26 +0100 Subject: add example in laravel --- .../iBook/resources/views/books/create.blade.php | 12 ++++++-- .../iBook/resources/views/books/edit.blade.php | 34 ++++++++++++++++++++++ .../iBook/resources/views/books/index.blade.php | 15 ++++++++++ .../LARAVEL/iBook/resources/views/layout.blade.php | 7 +++++ 4 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 Year_3/TSDWL/LARAVEL/iBook/resources/views/books/edit.blade.php create mode 100644 Year_3/TSDWL/LARAVEL/iBook/resources/views/books/index.blade.php create mode 100644 Year_3/TSDWL/LARAVEL/iBook/resources/views/layout.blade.php (limited to 'Year_3/TSDWL/LARAVEL/iBook/resources/views') diff --git a/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/create.blade.php b/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/create.blade.php index 398c7b4..5bd20b0 100644 --- a/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/create.blade.php +++ b/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/create.blade.php @@ -7,11 +7,11 @@ @csrf
- +
- +
@@ -19,8 +19,14 @@
- +
+ @endsection diff --git a/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/edit.blade.php b/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/edit.blade.php new file mode 100644 index 0000000..1889b18 --- /dev/null +++ b/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/edit.blade.php @@ -0,0 +1,34 @@ +@extends('layout') + +@section('content') +

Edit `{{ $book->name }}`

+ +
+ @csrf + @method('put') +
+ + +
+
+ + +
+
+ + is_online ? 'checked': ''); ?>> +
+
+ + +
+ +
+@endsection diff --git a/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/index.blade.php b/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/index.blade.php new file mode 100644 index 0000000..65a4a42 --- /dev/null +++ b/Year_3/TSDWL/LARAVEL/iBook/resources/views/books/index.blade.php @@ -0,0 +1,15 @@ +@extends('layout') + +@section('content') + +

Hello world! They're my books:

+@foreach ($books as $book) +

+ {{ $book->name }} + @if ($book->author_id) + by {{ $book->author->name }} + @endif +

+@endforeach + +@endsection diff --git a/Year_3/TSDWL/LARAVEL/iBook/resources/views/layout.blade.php b/Year_3/TSDWL/LARAVEL/iBook/resources/views/layout.blade.php new file mode 100644 index 0000000..e19db99 --- /dev/null +++ b/Year_3/TSDWL/LARAVEL/iBook/resources/views/layout.blade.php @@ -0,0 +1,7 @@ + + + + + @yield('content') + + -- cgit v1.2.3-18-g5258