0
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 3 years have passed since last update.

laravel調査

Last updated at Posted at 2020-10-02

まずmacのlaravel環境構築

■サーバーに配置して動かしたい(apache)
https://qiita.com/sskmy1024y/items/c2e434941400bd4ee82c

lalabeの基本コマンド

# サーバー起動
php artisan serve

# routes確認
php artisan route:list

# model作成
php artisan make:model User
		
# controller作成
php artisan make:controller HelloController

# mailer作成
php artisan make:mail SampleNotification

# migrate
php artisan make:migration create_users_table
php artisan migrate

Ractの導入

type script

調整・エラー対応

メールをsmtpで送信するように変更

 config/mail.php
    'mailers' => [
        'smtp' => [
            'transport' => 'smtp',
            'host' => 'localhost',
            'port' => '25',
            // 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
            // 'username' => env('MAIL_USERNAME'),
            // 'password' => env('MAIL_PASSWORD'),
            // 'timeout' => null,
            // 'auth_mode' => null,
        ],

RoutingでCotollerクラスが見つからないエラー

laravel8でroutingの書き方がちょっと変わったらしい。
web.phpを修正する

Route::get('posts', 'PostController@index');
Route::post('posts', 'PostsController@store');

use App\Http\Controllers\PostsController;
Route::get('posts', [PostsController::class, 'index']);
Route::post('posts_json', [PostsController::class, 'json']);

apacheで単純配置すると。public/index.php/ルートみたいに、なる index.phpまで明示しないと行けない

以下で行けるらしいが、うまくいかなかった..要調査。

Laravel 5.8 でpublic/index.phpを表示させないために.htaccessとserver.phpを追加と変更

Support for the experimental syntax 'classProperties' isn't currently enabled

以下で対応。.babelcはプロジェクトのrootに新規作成でOK。
https://gugutasuujimasa.blogspot.com/2018/12/babelsupport-for-experimental-syntax.html

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?