LoginSignup
0
0

More than 5 years have passed since last update.

【Laravelメモ②】ルーティング/コントローラ第一歩

Posted at

前提

【Laravelメモ①】ルーティング第一歩が終わっていること

動作確認

localhost:8000/test
すると「test」が表示される

手順

コントローラのファイル作成

[PJ]\app\Http\Controllers
<?php

namespace App\Http\Controllers;

use App\User;
use App\Http\Controllers\Controller;

class testController extends Controller
{
    public function test()
    {
        return 'test';
    }
}

ルーティング設定追加

web.php
Route::get('test','testController@test');
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0