Installation
Step-by-step guide for installing and configuring the CrunchzApp PHP SDK in your Laravel application.
Getting Started with CrunchzApp SDK
This guide will walk you through the process of installing and configuring the CrunchzApp PHP SDK for your Laravel application.
Requirements
Before you begin, ensure your environment meets the following requirements:
These requirements are essential for the proper functioning of the CrunchzApp SDK.
- PHP 7.3 or higher - The SDK requires PHP 7.3+ for optimal performance and security
- Composer - For package management and dependency resolution
- CrunchzApp account - You’ll need either a Channel Token or Global Token (available in your account)
Not sure which token to use? Global tokens provide access to all channels, while Channel tokens are specific to individual channels. Choose based on your application’s needs.
Installation
Follow these steps to install the SDK in your Laravel project:
Step 1: Install via Composer
Run the following command in your project directory:
After installation, you should see the package listed in your composer.json
file.
Configuration
Setting up the SDK requires two main steps:
Step 1: Publish Configuration Files
Before initializing the package, publish the configuration file by running:
This step is required to make the SDK work properly with your Laravel application.
Step 2: Configure Environment Variables
Add your CrunchzApp token to your .env
file:
For security reasons, never commit your token to version control. Always use environment variables.
Next Steps
After completing the installation and configuration, you’re ready to start using the CrunchzApp SDK in your Laravel application. Check out our API documentation for available methods and features.