# qbcore

&#x20;NM1 Notification Override (QBCore) -- --\[\[ Setup Instructions:

1. Place this file in the qb-core/client/ resource directory and name it `nm1notify.lua`.
2. Edit the `fxmanifest.lua` file inside qb-core.
3. Append the following line at the end of the manifest to guarantee proper load order:

   client\_script 'nm1notify.lua'
4. Restart the server to apply the changes. --]]

#### Light Theme 👇

{% code title="qb-core/client/nm1notify.lua" overflow="wrap" lineNumbers="true" fullWidth="false" expandable="true" %}

```lua
local originalNotify = QBCore.Functions.Notify

QBCore.Functions.Notify = function(text, texttype, length)
    if GetResourceState("nm1_notification") == "started" then
        local message = text
        local title = 'Notification'

        -- Handle table-based notify calls
        if type(text) == 'table' then
            message = text.text or text.caption or ''
            title = text.title or title
        end

        local notifyType = texttype or 'info'

        -- Normalize QBCore types → nm1 types
        if notifyType == 'primary' then notifyType = 'info' end
        if notifyType == 'warning' then notifyType = 'warning' end
        if notifyType == 'error' then notifyType = 'error' end
        if notifyType == 'success' then notifyType = 'success' end

        exports['nm1_notification']:Notify({
            title = title,
            message = message,
            type = notifyType,
            duration = length or 5000,
            theme = 'light' -- change to 'light' if needed
        })
    else
        -- Fallback to default QBCore notify
        originalNotify(text, texttype, length)
    end
end

```

{% endcode %}

#### Dark Theme 👇

{% code title="qb-core/client/nm1notify.lua" overflow="wrap" lineNumbers="true" fullWidth="false" expandable="true" %}

```lua
local originalNotify = QBCore.Functions.Notify

QBCore.Functions.Notify = function(text, texttype, length)
    if GetResourceState("nm1_notification") == "started" then
        local message = text
        local title = 'Notification'

        -- Handle table-based notify calls
        if type(text) == 'table' then
            message = text.text or text.caption or ''
            title = text.title or title
        end

        local notifyType = texttype or 'info'

        -- Normalize QBCore types → nm1 types
        if notifyType == 'primary' then notifyType = 'info' end
        if notifyType == 'warning' then notifyType = 'warning' end
        if notifyType == 'error' then notifyType = 'error' end
        if notifyType == 'success' then notifyType = 'success' end

        exports['nm1_notification']:Notify({
            title = title,
            message = message,
            type = notifyType,
            duration = length or 5000,
            theme = 'dark' -- change to 'light' if needed
        })
    else
        -- Fallback to default QBCore notify
        originalNotify(text, texttype, length)
    end
end

```

{% endcode %}
