1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【PHP】Laravel 学習メモ/ classの名前空間とuse宣言

Last updated at Posted at 2019-11-03

#クラスの名前空間とuse宣言
Controllerの最初に書きます。

名前空間: ファイルの場所を示す
use宣言: 中で使うファイルを宣言

<?php
namespace App\Http\クラスのディレクトリ;
use 使用するクラス
class クラス名 extends 継承するクラス名 {

}
?>

例:

<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class SampleController extends Controller{
  
}
?>
1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?