Bläddra i källkod

Add a default view

axkuhta 1 år sedan
förälder
incheckning
cbb3099ba2
3 ändrade filer med 32 tillägg och 3 borttagningar
  1. 8 0
      resources/views/index.blade.php
  2. 23 0
      resources/views/layouts/app.blade.php
  3. 1 3
      routes/web.php

+ 8 - 0
resources/views/index.blade.php

@@ -0,0 +1,8 @@
+
+@extends("layouts.app")
+
+@section("title", "Главная страница")
+
+@section("content")
+	<b>Здесь контент</b>
+@endsection

+ 23 - 0
resources/views/layouts/app.blade.php

@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>LaravelDemo - @yield('title')</title>
+		<style>
+			body {
+				font-family: sans-serif;
+				font-size: 16px;
+			}
+
+			.container {
+				max-width: 48rem;
+				margin: 0px auto;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="container">
+			@yield('content')
+		</div>
+	</body>
+</html>
+

+ 1 - 3
routes/web.php

@@ -13,6 +13,4 @@ use Illuminate\Support\Facades\Route;
 |
 */
 
-Route::get('/', function () {
-    return view('welcome');
-});
+Route::view('/', 'index');