LoginSignup
2
1

More than 5 years have passed since last update.

laravel写経ツアー あなたの脳の奥底に

Posted at

laravelを学習し初めて1週間程になるんですが、知らない用語だらけでパニックになっています。

基本的には何も分かっていないのですが、よく使うコマンドとか、用語とかをひたすら写経すれば何が分かっていないのかがわかるよね?次見たとき親しみやすいよね?知らないと気持ち悪いから勉強しちゃうよね?っ
ていう初心者向けモチベーションアップツアーを用意しました。

Tour of Monk (10分)

意味不明でも知ってても全部写経するツアーです。
ツアーを終えると、あなたは自分がどこに関する知識が疎いのかがわかり、モヤモヤとした気分になります。

VirtualBox
Vagrant
vagrantup
vagrantbox
Homestead
Homestead.yaml
Composer

laravel new laravelapp

composer create-project laravel/laravel --prefer-dist

php artisan serve

Route::get('/',function(){
return view('monk');
});

Route::get('hello/{msg}',function ($msg){});

php artisan make:controller MonkController

namespace App\Http\Controllers;
use Illuminate\Http\Request;

Route::get('monk','MonkController@index');

php artisan make:middleware MonkMiddleware

Route::get('monk','MonkController@index')
->middleware(MonkMiddleware::class);

グローバルミドルウェア
Kernel.php

$validate_rule =[
'name'=> 'required',
'mail'=> 'email',
];

{{ csrf_field()}}

database.php
.env

php artisan make:migration create_monk_table
composer dump-autoload

public function up()
{
Schema::create('monk',function (Blueprint $table){
$table->increments('id');
$table->string('name');
$table->integer('age');
});
}

php artisan migrate

php artisan make:seeder MonkTableSeeder

php artisan db:seed

Eloquent(ORM)

php artisan make:model Monk

$items = Monk::all();

hasOne結合
hasMany結合
belongsTo結合

Restful

php artisan make:auth

socialite

お疲れ様でした

僕はこの記事を書きながら殆どの用語について、よく分かっていないことを再確認することが出来ました。
このモヤモヤから解消される為には一つ一つの呪文を理解するしかありません。

勉強してきますね❤️

/*一瞬詰まったとこ。個人メモ
MAC
'unix_socket' => 'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
*/

2
1
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
2
1