LoginSignup
0
0

More than 3 years have passed since last update.

PHP初心者がMacでLaravelに挑む

Last updated at Posted at 2020-05-20

(試験的に勉強兼ねて英語で書いてみた)

Goal

  • To learn from the environment setup to the fundamental usage
  • To create a To-do app with Laravel

Environment setup

0. Development environment

Mac OS Catalina 10.15.4
MacBook Air (13-inch, Mid 2013)

1. Downloading & Installing

1.1. Choosing the version

Laravel 7 (the latest version as of May 2020)
PHP 7.3.11 (Laravel 7 requires above 7.2.5)

1.2. Installing composer

Composer
laravel1.png

Access the above website and click Download

laravel2.png

Execute these four lines on this webpage like:

$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
$ php composer-setup.php
$ php -r "unlink('composer-setup.php');"

They mean that in order:

・ Download the installer to the current directory
・ Verify the installer SHA-384
・ Run the installer
・ Remove the installer

Move Composer

$ mv composer.phar /usr/local/bin/composer

Check if it succeeded

$ composer -V
Composer version 1.10.6 2020-05-06 10:28:10

1.3. Installing Laravel

Create a project called sample, or what else you like.

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

1.4. Starting a server

Move into the directory you made and start a server.

$ cd sample
$ php artisan serve

Try to access your local server: http://localhost:8000 on a web browser!
laravel3.png

Congratulations!!

Creating a ToDo app

Now I start to create a ToDo app known as that is simple and easy to develop for even a beginner.
I referred to this website:
Laravelの知識ゼロから基本をマスターするチュートリアル | Awesome Blog

References

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