# Configuration

**Step 1 - Locating the config.php file**

Locate the config.php file inside of File Manager. This will be in public\_html or the sub folder. When you have located the config file double click it to open the file and edit it.

**Step 2 - Base URL**

The base url can be located at the top of the config file

```
// Panel URL \\
define('BASE_URL', 'https://localhost/hamzcad');
```

Replace the base url with your link. IMPORTANT: Make sure there is no `/` at the end of the base url.

**Step 3 - SQL DATABASE CONNECTION**

```
// SQL DATABASE CONNECTION \\
define('DB_HOST', 'localhost'); // Keep this unless your db is hosted elsewhere
define('DB_USER', 'root'); // Replace root with DB username
define('DB_PASSWORD', ''); // Add DB Password inside of the ''
define('DB_NAME', 'hamzproduct'); // Replace hamzcad with DB name
```

**Step 4 - DISCORD OAUTH2**

```
// DISCORD OAUTH2 \\
define('TOKEN', 'TOKEN-HERE');
define('GUILD_ID', 'GUILD-ID-HERE');
define('OAUTH2_CLIENT_ID', 'CLIENT-ID-HERE');
define('OAUTH2_CLIENT_SECRET', 'CLIENT-SECRET-HERE');
```

Head to the [Discord Developer Portal](https://discord.com/developers/applications).

Create a application.

<figure><img src="/files/K9a0c77oqXkFWuZPMnyi" alt=""><figcaption></figcaption></figure>

First we will get the bot token. Head to the bot navigation on your application and create the bot. When you have created the bot click on the Copy button under the token.

<figure><img src="/files/JHJG26bFh6kv8eMRnUas" alt=""><figcaption></figcaption></figure>

Now that you have that copied replace TOKEN-HERE with the token you have copied.

Guild ID. = Right click on your servers profile image on discord and press COPY ID if this is not a option you will have to enable developer mode in the discord settings.

Now replace GUILD-ID-HERE with the ID you now have copied.

OAUTH2 CLIENT ID. = On the dev portal head to OAuth2 section.

<figure><img src="/files/mYF7vGeI0eovASxUuHhW" alt=""><figcaption></figcaption></figure>

Now head to the client id and press the copy button.

<figure><img src="/files/hpayamQH0GeLFkMKwFZb" alt=""><figcaption></figcaption></figure>

Now replace the OAUTH2\_CLIENT\_ID with the ID you have copied.

OAUTH2 CLIENT SECRET = On the dev portal OAuth2 section copy the secret key.

<figure><img src="/files/ZsLN5RuQVDI8WPdirImd" alt=""><figcaption></figcaption></figure>

Now replace OAUTH2\_CLIENT\_SECRET with what you have copied.

Make sure that the application is inside your discord server. You can do that via the below link.

> [https://discordapp.com/oauth2/authorizeclient\_id=CLIENT\_ID\_HERE\&scope=bot\&permissions=0](https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID_HERE\&scope=bot\&permissions=0)\
> Replace CLIENTIDHERE with the applications client ID.

Finally, Set the **OAuth2 Redirect** here: (link + /actions/register.php)

<figure><img src="/files/dUVJcgmeOjrupGCBSxV3" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hamz.dev/hamz-department-panel/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
