# Config

## Framework Related [#framework-related]
### server/esx.lua [#serveresxlua]
<div className="bg-fd-background rounded-lg prose-no-margin">
```lua title="server/esx.lua"
return {
	identifier_prefix = "char", -- Make sure it matches whatever you had before, although the resource will attempt to auto detect this.
	database = {
		-- Toggle the deletion (this will wipe any table listed below for any deleted character)
		---@type boolean
		cleanup = false,

		-- A list of tables that you wish to clean when they are deleted.
		---@type table<string>
		tables = {
			{ name = 'users',          column = 'identifier' },
			{ name = 'owned_vehicles', column = 'owner' },
			-- { name = 'playerskins', column = 'citizenid' },
			-- { name = 'player_outfits', column = 'citizenid' },
		},
	}
}
```
</div>

### server/qbox.lua [#serverqboxlua]
<div className="bg-fd-background rounded-lg prose-no-margin">
```lua title="server/qbox.lua"
--#region Modules
local log = require("modules.utility.shared.logger")
--#endregion

---@class IQboxCoreStarterItems
---@field name string
---@field amount integer
---@field metadata fun(client: integer): table

---@class IQboxSharedConfigResponse
---@field serverName string
---@field defaultSpawn vector4
---@field notifyPosition string
---@field starterItems IQboxCoreStarterItems

return {
	--- Gets the starter items.
	---@return IQboxCoreStarterItems[]
	get_starter_items = function()
		if GetResourceState("qbx_core") == "missing" then
			log.warningf("[qbox::get_starter_items] `qbx_core` is missing, returning nothing.")
			return {}
		end

		local data = LoadResourceFile("qbx_core", "config/shared.lua")

		if not data then return {} end

		local success, result = pcall(load, data)

		if not success then
			log.warningf("[qbox::get_starter_items] Failed to load Lua code (Got - %s)", result)
			return {}
		end

		---@type boolean, IQboxSharedConfigResponse?
		local execute_success, config_table = pcall(result --[[@as fun()]])

		if not execute_success then
			log.warningf("[qbox::get_starter_items] Failed to execute Lua code (Got - %s)", config_table)
			return {}
		end

		if not config_table or not config_table.starterItems then
			log.warningf("[qbox::get_starter_items] No starter items found in config")
			return {}
		end

		return config_table.starterItems
	end,
}
```
</div>

### shared/qb.lua [#sharedqblua]
<div className="bg-fd-background rounded-lg prose-no-margin">
```lua title="shared/qb.lua"
return {
	support_starting_apartments = GetResourceState("qb-apartments") ~= "missing"
}
```
</div>

### shared/qbox.lua [#sharedqboxlua]
<div className="bg-fd-background rounded-lg prose-no-margin">
```lua title="shared/qbox.lua"
return {
	support_starting_apartments = GetResourceState("qbx_properties") ~= "missing"
}
```
</div>
