aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-11-06 17:25:22 +0100
committerMateja <mail@matejamaric.com>2020-11-06 17:25:22 +0100
commit7af18c65418027a4cc1cb9fe71f11489029c3912 (patch)
treeec86b4b0590fa2603c7d5384ebc6ded003d9b5fe
parent8503bedc8475543e8b20b40fe4c43576d151ae05 (diff)
downloadyota-laravel-7af18c65418027a4cc1cb9fe71f11489029c3912.tar.gz
yota-laravel-7af18c65418027a4cc1cb9fe71f11489029c3912.zip
GalleryController, better news, using Bootstrap.
-rw-r--r--app/Http/Controllers/GalleryController.php84
-rw-r--r--app/Http/Controllers/PagesController.php5
-rw-r--r--app/Providers/AppServiceProvider.php3
-rw-r--r--resources/views/pages/news.blade.php11
-rw-r--r--routes/web.php5
5 files changed, 95 insertions, 13 deletions
diff --git a/app/Http/Controllers/GalleryController.php b/app/Http/Controllers/GalleryController.php
new file mode 100644
index 0000000..efbb55f
--- /dev/null
+++ b/app/Http/Controllers/GalleryController.php
@@ -0,0 +1,84 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+
+class GalleryController extends Controller
+{
+ /**
+ * Display a listing of the resource.
+ *
+ * @return \Illuminate\Http\Response
+ */
+ public function index()
+ {
+ return view('pages.gallery');
+ }
+
+ /**
+ * Show the form for creating a new resource.
+ *
+ * @return \Illuminate\Http\Response
+ */
+ public function create()
+ {
+ //
+ }
+
+ /**
+ * Store a newly created resource in storage.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @return \Illuminate\Http\Response
+ */
+ public function store(Request $request)
+ {
+ //
+ }
+
+ /**
+ * Display the specified resource.
+ *
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function show($id)
+ {
+ //
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ *
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function edit($id)
+ {
+ //
+ }
+
+ /**
+ * Update the specified resource in storage.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function update(Request $request, $id)
+ {
+ //
+ }
+
+ /**
+ * Remove the specified resource from storage.
+ *
+ * @param int $id
+ * @return \Illuminate\Http\Response
+ */
+ public function destroy($id)
+ {
+ //
+ }
+}
diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php
index 5ca01c7..2721fda 100644
--- a/app/Http/Controllers/PagesController.php
+++ b/app/Http/Controllers/PagesController.php
@@ -12,11 +12,6 @@ class PagesController extends Controller
return view('pages.index');
}
- public function gallery(Request $request)
- {
- return view('pages.gallery');
- }
-
public function sponsoring(Request $request)
{
return view('pages.sponsoring');
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index ee8ca5b..d1f5496 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
+use Illuminate\Pagination\Paginator;
class AppServiceProvider extends ServiceProvider
{
@@ -23,6 +24,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
- //
+ Paginator::useBootstrap();
}
}
diff --git a/resources/views/pages/news.blade.php b/resources/views/pages/news.blade.php
index 1e9b83b..5858889 100644
--- a/resources/views/pages/news.blade.php
+++ b/resources/views/pages/news.blade.php
@@ -4,11 +4,12 @@
@section('content')
@foreach($news as $post)
- <div class="well border border-secondary rounded p-2 mb-3">
- <h2>{{ $post->title }}</h2>
- <small>Published at {{ $post->created_at->format('Y-m-d') }}@isset ($post->author) by {{$post->author }}@endisset</small>
- <hr class="bg-secondary">
- <div>{!! $post->text !!}</div>
+ <div class="card mb-3">
+ <div class="card-body">
+ <h2 class="card-title">{{ $post->title }}</h2>
+ <h6 class="card-subtitle mb-2 text-muted">Published at {{ $post->created_at->format('Y-m-d') }}@isset ($post->author) by {{$post->author }}@endisset</h4>
+ <div class="card-text">{!! $post->text !!}</div>
+ </div>
</div>
@endforeach
@endsection()
diff --git a/routes/web.php b/routes/web.php
index aa5492b..7797a17 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,9 +1,10 @@
<?php
use Illuminate\Support\Facades\Route;
+use App\Http\Controllers\PagesController;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\NewsController;
-use App\Http\Controllers\PagesController;
+use App\Http\Controllers\GalleryController;
use App\Http\Controllers\ReservationsController;
use App\Http\Controllers\SpecialCallsController;
@@ -30,7 +31,7 @@ Route::post('/news/edit/{id}', [NewsController::class, 'update'])->name('newsEdi
Route::get('/news/delete/{id}', [NewsController::class, 'destroy'])->name('newsDelete')->middleware(['auth']);
-Route::get('/gallery', [PagesController::class, 'gallery'])->name('gallery');
+Route::get('/gallery', [GalleryController::class, 'index'])->name('gallery');
Route::get('/special-calls', [ReservationsController::class, 'index'])->name('activities');