質問編集履歴

1

足りない情報追記

2022/05/26 08:39

投稿

bluepiani0788
bluepiani0788

スコア51

test CHANGED
File without changes
test CHANGED
@@ -26,6 +26,139 @@
26
26
  #1 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(59): Illuminate\\View\\Engines
27
27
  ~
28
28
  "}
29
+
30
+ ```
31
+ web.phpは
32
+ ```
33
+ <?php
34
+
35
+ Route::get('/', function () {
36
+ return view('welcome');
37
+ });
38
+
39
+ Auth::routes();
40
+
41
+ Route::get('/home', 'HomeController@index')->name('home');
42
+
43
+ ?>
44
+ ```
45
+ welcome.blade.php
46
+ ```
47
+ <!doctype html>
48
+ <html lang="{{ app()->getLocale() }}">
49
+ <head>
50
+ <meta charset="utf-8">
51
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
52
+ <meta name="viewport" content="width=device-width, initial-scale=1">
53
+
54
+ <title>Laravel</title>
55
+
56
+ <!-- Fonts -->
57
+ <link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
58
+
59
+ <!-- Styles -->
60
+ <style>
61
+ html, body {
62
+ background-color: #fff;
63
+ color: #636b6f;
64
+ font-family: 'Raleway', sans-serif;
65
+ font-weight: 100;
66
+ height: 100vh;
67
+ margin: 0;
68
+ }
69
+
70
+ .full-height {
71
+ height: 100vh;
72
+ }
73
+
74
+ .flex-center {
75
+ align-items: center;
76
+ display: flex;
77
+ justify-content: center;
78
+ }
79
+
80
+ .position-ref {
81
+ position: relative;
82
+ }
83
+
84
+ .top-right {
85
+ position: absolute;
86
+ right: 10px;
87
+ top: 18px;
88
+ }
89
+
90
+ .content {
91
+ text-align: center;
92
+ }
93
+
94
+ .title {
95
+ font-size: 84px;
96
+ }
97
+
98
+ .links > a {
99
+ color: #636b6f;
100
+ padding: 0 25px;
101
+ font-size: 12px;
102
+ font-weight: 600;
103
+ letter-spacing: .1rem;
104
+ text-decoration: none;
105
+ text-transform: uppercase;
106
+ }
107
+
108
+ .m-b-md {
109
+ margin-bottom: 30px;
110
+ }
111
+ </style>
112
+ </head>
113
+ <body>
114
+ <div class="flex-center position-ref full-height">
115
+ @if (Route::has('login'))
116
+ <div class="top-right links">
117
+ @auth
118
+ <a href="{{ url('/home') }}">Home</a>
119
+ @else
120
+ <a href="{{ route('login') }}">Login</a>
121
+ <a href="{{ route('register') }}">Register</a>
122
+ @endauth
123
+ </div>
124
+ @endif
125
+
126
+ <div class="content">
127
+ <div class="title m-b-md">
128
+ Laravel
129
+ </div>
130
+
131
+ <div class="links">
132
+ <a href="https://laravel.com/docs">Documentation</a>
133
+ <a href="https://laracasts.com">Laracasts</a>
134
+ <a href="https://laravel-news.com">News</a>
135
+ <a href="https://forge.laravel.com">Forge</a>
136
+ <a href="https://github.com/laravel/laravel">GitHub</a>
137
+ </div>
138
+ </div>
139
+ </div>
140
+ </body>
141
+ </html>
142
+
143
+ ```
144
+ route.phpというのはroutes.phpのことですか?それなら↓です。
145
+ ```
146
+ <?php
147
+
148
+ use Illuminate\Routing\Router;
149
+
150
+ Admin::routes();
151
+
152
+ Route::group([
153
+ 'prefix' => config('admin.route.prefix'),
154
+ 'namespace' => config('admin.route.namespace'),
155
+ 'middleware' => config('admin.route.middleware'),
156
+ 'as' => config('admin.route.prefix') . '.',
157
+ ], function (Router $router) {
158
+
159
+ $router->get('/', 'HomeController@index')->name('home');
160
+
161
+ });
29
162
 
30
163
  ```
31
164