How to install Laravel on MacOS:
Laravel is a free and open source web framework written in PHP. It is created by Taylor Otwell. It follows MVC development approach. As of March, 2015, Laravel is regarded as one of the most popular PHP based framework. It provides advanced alternative to CodeIgniter which is not intended to built-in user authorization. In this tutorial, we will install Laravel on MacOS.
Installation includes following steps.
Install Xcode Command Line Tools:
Xcode is an integrated development environment for macOS, and it contains tools that Homebrew needs to function properly.
Follow these steps:
- From the Finder, select Go and click Utilities to display all the utilities.
- Locate and launch the Terminal app.
- In the terminal, run the following command to install Xcode command line tools:
- Click Install when prompted to proceed with the installation.
- The script displays the Xcode License Agreement. If you agree to the terms, click Agree and wait for the installation to finish.
Homebrew is a free macOS package manager that allows you to install, update, or remove software by running commands in the terminal. Use Homebrew to easily install the latest versions of various developer tools for macOS, such as PostgreSQL, Python, PHP, Nginx, etc.
- Download the installation script:
Users running macOS High Sierra, Sierra, El Capitan, or earlier, run:
/usr/bin/ruby -e "$(curl
- Users running Catalina, Mojave, or Big Sur, run:
/bin/bash -c "$(curl -fsSL
Enter your administrator password when prompted and press Return/Enter to continue. Wait for the download to finish.
The installation script lets you know which changes it will make on your computer.
Press Return/Enter to install Homebrew. The installation may take a couple of minutes, so wait for the Installation successful message to appear.
Turn Off Analytics:
Homebrew collects some system information by default and sends it back to the developers. It collects the following:
- The Homebrew user agent.
- Google Analytics version.
- Homebrew analytics tracking ID and Homebrew analytics user ID.
- Events, e.g., Homebrew
Disable the analytic data collection by running:
brew analytics off
After disabling analytics, you can check the analytic data collection status by running:
After installing homebrew you need to install node and composer.
Installation of Node and Composer:
Brew install node
Brew install composer
How to install larvael using command in mac:
Run the below command;
composer create-project --prefer-dist laravel/laravel:^9.0 project_name
That's it now your laravel project is created in the given directory and below is the further command for Homebrew package. But these commands are not necessary for installing laravel, these are just for your knowledge.
Install, Update or Remove Packages:
if you want to remove node and npm, then below are the commands for removing node and npm from mac system
Brew remove node
Brew uninstall –-force node
Brew uninstall –-force npm
You can install packages using Homebrew using the following syntax:
brew install [package name]
For example, to install the
tree command to enable a graphical representation of a directory tree, enter:
brew install tree
The command updates the Homebrew package list and installs the
To see a list of packages that need updating, run the following command:
Use the following syntax to update a specific package:
brew update [package name]
To check if you have the latest Homebrew version, run this command:
Sometimes, there are dependencies between the software you want to uninstall and the software you are still using. Verify by using the following syntax:
brew deps [package name]
To uninstall a package regardless of software dependencies, use the following syntax:
brew uninstall --ignore-dependencies [package name]
If you no longer need certain software that you previously installed via Homebrew, remove it from your system with the following syntax:
brew uninstall [package name]
Forexample brew uninstall tree
In the example above, we uninstalled the
How to Uninstall Homebrew:
On macOS Catalina, Big Sur, and Mojave:
/bin/bash -c "$(curl -fsSL
On macOS High Sierra, Sierra, El Capitan, or earlier:
ruby -e "$(curl -fsSL
The system notifies you which Homebrew files it will remove and asks for confirmation. Type and press Return/Enter to uninstall Homebrew from your system.
After following the steps in this tutorial, you should have Homebrew installed on your system. The benefits of using Homebrew are numerous. It holds a variety of software packages in one place, offers thousands of command-line-based tools, as well as many apps that aren't available in the App Store.
- Adding Google ReCaptcha to forms in Laravel 13 Sep 2022
- How to install Node js and NPM on Windows 03 Sep 2022
- How to install Laravel on Windows 03 Sep 2022
- How to Install Xampp Server 16 Jul 2022