前提・実現したいこと
DockerとLaravelで開発してるんですが、あるbladeを雛形にして新たに作成、web.phpを書いて、ブラウザを更新して確認しようとした所、変更前と何も変わりませんでした。一応、雛形のbladeも載せておきます。
しかし、変更したからどうこうと言ってる訳ではなく、あくまで質問は「DockerとLaravelを使用してて起動時のコマンドは下記1つ目 /var/www/html # php artisan serve であってますか?」「(http://127.0.0.1:8000) startedの表示の後、リフレッシュする時っていちいちコマンドプロンプト閉じないといけないんですか?しなくてもいい手順は?」です。その他、baldeに関し気づいた事あったら回答してもいいですが。(ベテランさんたちと一緒にやってますが、その人たちがこのようなサイトに質問してURL共有してと言う指示が出されてますので書いてます)
該当のソースコード
Microsoft Windows [Version 10.0.19043.1526] (c) Microsoft Corporation. All rights reserved. C:\WINDOWS\system32>cd C:\admin C:\admin>docker-compose exec app sh /var/www/html # php artisan serve Laravel development server started: <http://127.0.0.1:8000> [Sun Feb 27 14:19:53 2022] PHP 7.4.14 Development Server (http://127.0.0.1:8000) started
雛形にしてと言われた店舗一覧balde @extends('dashboard-layout') @section('content') <h1>店舗一覧</h1> <a href="{{ route('admin.stores.create') }}" class="btn btn-success">作成</a> <table class="table"> <thead> <tr> <th class="text-center">#</th> <th>店舗名</th> {{--<th>クーポン</th>--}} <th>url</th> </tr> </thead> <tbody> @foreach($stores as $store) <tr> <td class="text-center">{{ $store->id }}</td> <td>{{ $store->name }}</td> {{--<td>Develop</td>--}} <td><a href="{{ $store->url }}" target="_blank">{{ $store->url }}</a></td> <td class="td-actions text-right"> {{--<button type="button" rel="tooltip" class="btn btn-info">--}} {{--<i class="material-icons">person</i>--}} {{--</button>--}} <button type="button" rel="tooltip" class="btn btn-success"> <a href="{{ route('admin.stores.edit', [$store->id]) }}" class="text-white"><i class="material-icons">edit</i></a> </button> <button type="button" rel="tooltip" class="btn btn-danger"> <i class="material-icons">close</i> </button> </td> </tr> @endforeach </tbody> </table> @endsection
作成したユーザー一覧 @extends('dashboard-layout') @section('content') <h1>ユーザー一覧</h1> <a href="{{ route('admin.users.create') }}" class="btn btn-success">作成</a> <table class="table"> <thead> <tr> <th class="text-center">#</th> <th>ユーザー名</th> <th>メールアドレス</th> </tr> </thead> <tbody> @foreach($users as $user) <tr> <td class="text-center">{{ $user->id }}</td> <td>{{ $user->name }}</td> <td>{{ $user->mail }}</td> {{--<td>Develop</td>--}} <td class="td-actions text-right"> {{--<button type="button" rel="tooltip" class="btn btn-info">--}} {{--<i class="material-icons">person</i>--}} {{--</button>--}} <button type="button" rel="tooltip" class="btn btn-success"> <a href="{{ route('admin.users.edit', [$user->id]) }}" class="text-white"><i class="material-icons">edit</i></a> </button> <button type="button" rel="tooltip" class="btn btn-danger"> <i class="material-icons">close</i> </button> </td> </tr> @endforeach </tbody> </table> @endsection
ついでに <?php /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::get('/', function () { return view('welcome'); }); Auth::routes(); Route::get('/home', 'HomeController@index')->name('home'); Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin'], function () { Route::get('/', function () { return view('admin.dashboard-home'); }); Route::group(['prefix' => 'stores', 'as' => 'stores.'], function () { Route::get('/', 'StoreController@index')->name('index'); Route::get('create', 'StoreController@create')->name('create'); Route::get('{store}/edit', 'StoreController@edit')->name('edit'); Route::patch('{store?}', 'StoreController@update')->name('update'); Route::put('{store?}', 'StoreController@update')->name('create.exec'); }); Route::group(['prefix' => 'coupons', 'as' => 'coupons.'], function () { Route::get('/', 'CouponController@index')->name('index'); Route::get('create', 'CouponController@create')->name('create'); Route::get('{coupon}/edit', 'CouponController@edit')->name('edit'); Route::patch('{coupon?}', 'CouponController@update')->name('update'); Route::put('{coupon?}', 'CouponController@update')->name('create.exec'); Route::get('{coupon?}', 'CouponController@detail')->name('detail'); }); Route::group(['prefix' => 'users', 'as' => 'users.'], function () { Route::get('/', 'UserController@index')->name('index'); Route::get('create', 'UserController@create')->name('create'); Route::get('{user}/edit', 'UserController@edit')->name('edit'); Route::patch('{user?}', 'UserController@update')->name('update'); Route::put('{user?}', 'UserController@update')->name('create.exec'); }); });
補足情報(FW/ツールのバージョンなど)
コントローラは私でなくベテランが書いたので間違いないと思います。

回答2件
あなたの回答
tips
プレビュー