$blog_data[0]->title

How to install Laravel on MacOS:

Introduction:

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:

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:

  1. From the Finder, select Go and click Utilities to display all the utilities.
  2. Locate and launch the Terminal app.
    Open Terminal
  3. In the terminal, run the following command to install Xcode command line tools:
    xcode-select --install
  4. Click Install when prompted to proceed with the installation.
    Installation Promp
  5. The script displays the Xcode License Agreement. If you agree to the terms, click Agree and wait for the installation to finish.
    Agree With Terms And Conditions

Install Homebrew:

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.

  1. Download the installation script:

    Users running macOS High Sierra, Sierra, El Capitan, or earlier, run:

    /usr/bin/ruby -e "$(curl
    -fsSL https://raw.githubusercontent.com
    /Homebrew/install/master/install)"

  2. Users running Catalina, Mojave, or Big Sur, run:

    /bin/bash -c "$(curl -fsSL
    https://raw.githubusercontent.com
    /Homebrew/install/master/install.sh)"

Enter your administrator password when prompted and press Return/Enter to continue. Wait for the download to finish.
Verification Password

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 install event category.

Disable the analytic data collection by running:

brew analytics off

After disabling analytics, you can check the analytic data collection status by running:

brew analytics

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 tree command.

To see a list of packages that need updating, run the following command:

brew outdated

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:

brew update

Removing packages:

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 tree package.

How to Uninstall Homebrew:

On macOS Catalina, Big Sur, and Mojave:

/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com
/Homebrew/install/HEAD/uninstall.sh)"

On macOS High Sierra, Sierra, El Capitan, or earlier:

ruby -e "$(curl -fsSL
https://raw.githubusercontent.com
/Homebrew/install/master/uninstall)"

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.

Conclusion:

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.

1 Comments

  • shaheryar bhatti

    shaheryar bhatti

    03 Sep 2022 04:30
    Thanks guys! let us know if you have any question.

Post Comment