Laravel - Create API Site Using Laragon

Laravel v10.44.0 (PHP v8.2.11)

[1] Create new Laravel project

Right-click anywhere on the main window of Laragon Control Panel.

Type the name of the project.

e.g. rearnet

Wait for Laragon to create the project. Messages will be communicated through the console window. Notice that Laragon has created a Pretty Url based on the given project name e.g. rearnet.test

Test that the project page is accessible via ...

http://rearnet.test

or

http://localhost/rear/public/

[2] Site configuration

Start with a simple configuration. Use sqlite database.

APP_NAME=REARNET

DB_CONNECTION=sqlite

DB_DATABASE=../database/rearnet.sqlite

The above configuration is valid for server runtime.

If you want to run console command on a windows local machine, you need to change the path as follows. Otherwise the console could not find the database file.

DB_DATABASE=database/rearnet.sqlite

Add email configuration (to be used later in certain processes such as user sign up).

MAIL_MAILER=smtp
MAIL_HOST=mail.razzi.my
MAIL_PORT=465
MAIL_USERNAME=rear@razzi.my
MAIL_PASSWORD=[yourpassword]
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="rear@razzi.my"
MAIL_FROM_NAME="${APP_NAME}"

Alternatively, use mailtrap configuration.

MAIL_MAILER=smtp
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=465
MAIL_USERNAME=fa0aa2fdd2aa2a
MAIL_PASSWORD=b853dc8e4d27ad
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="rear@razzi.my"
MAIL_FROM_NAME="${APP_NAME}"

Save.

Restart and refresh the browser.

[3] Test Publish.

Upload the zip file to a live server.

e.g. public_html/demo/rearnet

View the site (without virtual host configuration):

https://demo.razzi.my/rearnet/public/

The website is displayed as expected.