LARAVEL API TUTORIAL - INSTALLATION (PART 1)
ฝัง
- เผยแพร่เมื่อ 8 ต.ค. 2024
- Learn how to install Laravel and set up your first API in this step-by-step tutorial. In part 1, we cover everything from installing Laravel via Composer to configuring your development environment. Perfect for beginners looking to start their Laravel API journey. Subscribe for more Laravel tutorials!
*1. Install Prerequisites*
*Windows*
1. **Install PHP**: You can install PHP via XAMPP or manually. [PHP documentation](www.php.net/ma...)
2. **Install Composer**: Download Composer from the official Composer website.
3. **Install Git**: Download and install [Git](git-scm.com/do....
4. **Install Node.js**: Download and install [Node.js](nodejs.org/). This is needed for frontend assets like Vue or React. Node.js Documentation
*Mac (Apple Silicon)*
1. **Install Homebrew**: [Homebrew](brew.sh/) is a package manager for macOS.
```bash
bash
Copy code
/bin/bash -c "$(curl -fsSL raw.githubuser...)"
```
2. **Install PHP**:
```bash
bash
Copy code
brew install php
```
3. **Install Composer**:
```bash
bash
Copy code
brew install composer
```
4. **Install Node.js**:
```bash
bash
Copy code
brew install node
```
###
*2. Install Laravel*
Laravel requires Composer to install.
1. Install Laravel using Composer globally:
```bash
bash
Copy code
composer global require laravel/installer
```
[Laravel Installation Documentation](laravel.com/do...)
2. Create a new Laravel project:
```bash
bash
Copy code
laravel new todo-api
```
3. Navigate into your project directory:
```bash
bash
Copy code
cd todo-api
```