Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Natural Language

Laravel Natural Language Laravel Package

joggapp/laravel-natural-language

Laravel Natural Language wraps Google's Cloud Natural Language API in a clean, fluent package, letting you run sentiment analysis, entity recognition, and syntax parsing on text in just a few lines of code. Simple to install via Composer and fully config-driven.

View on GitHub
Deep Wiki
Context7

This package makes using the Google Natural Language API in your laravel app a breeze with minimum to no configuration, clean syntax and a consistent package API.

Frequently asked questions about Laravel Natural Language
What does joggapp/laravel-natural-language do?
It is a Laravel wrapper around Google's Cloud Natural Language API, giving you a fluent, consistent package API for common text-analysis tasks. You can run sentiment analysis, entity recognition, and syntax parsing on a piece of text without hand-writing Google API client code. Installation is via Composer and the package is config-driven, so most apps need little or no configuration beyond credentials.
How do I install joggapp/laravel-natural-language?
Install it with Composer using composer require joggapp/laravel-natural-language. The package's service provider is auto-discovered in Laravel, so no manual registration is normally needed. After installing, publish the config file if you want to customise it, then supply your Google Cloud credentials.
How do I configure Google Cloud credentials for this package?
The package talks to the Google Natural Language API, so you need a Google Cloud project with the API enabled and a service account or application-default credentials. Point the package config at your credentials file, or rely on the standard Google application-default credentials environment variable. Keep the credentials file out of version control and inject it via environment configuration in production.
How do I run sentiment analysis on text with this Laravel package?
Use the package's facade or helper to pass a string of text to the sentiment method, which returns the API response including the sentiment score and magnitude. You do not need to build the Google request payload yourself. Wrap the call in a service class or job so controllers stay thin and the work can be queued for long text.
What is entity recognition and how is it used through this package?
Entity recognition identifies people, organisations, locations, events, and other named entities in your text along with their type and salience. Through this package you call the entity method with your text and receive the parsed entities from Google. This is useful for tagging content, building search facets, or extracting structured data from free text.
Can this package do syntax analysis and part-of-speech tagging?
Yes. The syntax analysis feature returns token-level information such as part-of-speech tags, lemmas, and dependency relationships. That makes it useful for linguistic processing, keyword extraction, or building custom text classifiers. As with the other features, you simply pass text to the relevant package method and receive the Google API response.
Which Laravel and PHP versions does joggapp/laravel-natural-language support?
Support depends on the package release you install, so check the composer.json constraints and release notes on the GitHub repository before upgrading. Newer releases target modern Laravel versions and require PHP 8.1 or higher, while older releases support earlier Laravel lines. Pin an explicit version constraint in composer.json so an unattended composer update cannot cross a major boundary.
Does using this package cost money?
The package itself is free and open source, but every call goes to the Google Cloud Natural Language API, which is a paid Google service. Google offers a free tier and per-unit pricing beyond it, so monitor usage and cache results where possible. For high-volume text processing, batch requests and store analysis results rather than re-analysing the same content.
How should I handle errors and test code that uses this package?
Google API calls can fail due to quota limits, invalid credentials, or network issues, so wrap calls in try/catch blocks and consider retries with backoff for transient failures. In tests, mock or fake the package's client rather than hitting the real API so your test suite stays fast and deterministic. Avoid hard-coding API keys in code or test fixtures.
Is joggapp/laravel-natural-language a good choice versus calling the Google SDK directly?
This package is a thin Laravel-friendly layer over Google's API, so it saves you from wiring up the Google Cloud client, config, and facades yourself. If you only need one call and already use the official google/cloud-language library, calling it directly is a valid alternative. Choose this package when you want clean Laravel syntax, config publishing, and consistent method names across sentiment, entity, and syntax features.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core