Download the PHP package sanjokdangol/apicall without Composer
On this page you can find all versions of the php package sanjokdangol/apicall. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sanjokdangol/apicall
More information about sanjokdangol/apicall
Files in sanjokdangol/apicall
Package apicall
Short Description Internal API Call Service for Laravel - Make authenticated API requests within your application kernel
License MIT
Informations about the package apicall
ApiCall - Laravel Internal API Service
Internal API call service for Laravel applications. Make authenticated API requests within your application kernel without external HTTP overhead.
Features
- ๐ In-Process Requests - No external HTTP calls
- ๐ User Authentication - Authenticate as any user
- ๐ฏ Fluent API - Beautiful, chainable interface
- ๐งช Testing Ready - Like
TestCase::actingAs() - ๐ Clean Response - Multiple response formats
- ๐ Debugging - Built-in debugging utilities
- โก Queue-Ready - Perfect for jobs and commands
- ๐ Token-Based - Support for API tokens and scopes
Installation
Step 1: Add Repository (For Development)
In your project's composer.json, add the path repository:
Step 2: Require the Package
Note: This package is meant for development and testing environments. It's added to
require-dev.
Step 3: Auto-Discovery
Laravel will auto-discover the service provider. To verify:
Step 4: (Optional) Publish Configuration
This creates config/apicall.php for custom configuration.
Quick Start
Basic Usage
In Controllers
In Services
In Jobs/Commands
In Tests
API Reference
Authentication Methods
actingAs(Authenticatable $user, array $scopes = [], string $tokenName = 'ApiCall')
Authenticate as a specific user for API requests.
asUser(Authenticatable $user, array $scopes = [], string $tokenName = 'ApiCall')
Alias for actingAs().
withToken(string $token)
Use a specific API token instead of generating one.
HTTP Methods
get(string $url, array $query = [])
Perform a GET request.
post(string $url, array $data = [])
Perform a POST request.
put(string $url, array $data = [])
Perform a PUT request.
patch(string $url, array $data = [])
Perform a PATCH request.
delete(string $url, array $data = [])
Perform a DELETE request.
Response Methods
clean(bool $state = true)
Return only the response data, not the full Response object.
response(bool $state = true)
Return the full Response object.
dd(bool $state = true)
Debug the request and response, then exit.
Configuration
Publishing the Config File
Configuration Options
Use Cases
1. Internal Service Communication
2. Testing API Endpoints
3. Background Jobs
4. Cross-Module Communication
5. Webhooks & Event Handlers
Package Directory Structure
Development
Project Configuration
| Aspect | Details |
|---|---|
| Package Name | sanjokdangol/apicall |
| Namespace | Sanjokdangol\ApiCall |
| Facade | ApiCall |
| Service Key | apicall |
| Minimum PHP | 7.3 / 8.0+ |
| Minimum Laravel | 8.12+ |
| Type | Development Package |
| License | MIT |
Running Tests
Publishing Documentation
Troubleshooting
Package Not Auto-Discovered
Facade Not Found
Ensure the package is installed:
Manually register in config/app.php if needed:
Class Not Found
Clear and regenerate autoloader:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This package is open-source software licensed under the MIT license.
Support
For issues, questions, or suggestions, please open an issue on the repository.
Made with โค๏ธ for Laravel developers
---
## Key Updates Made:
1. โ
Changed package name from `sanjokDangol/apicall` to `sanjokdangol/apicall`
2. โ
Updated namespace from `SanjokDangol\ApiCall` to `Sanjokdangol\ApiCall`
3. โ
Added `require-dev` note explaining development-only package
4. โ
Added repository configuration instructions
5. โ
Added comprehensive API reference
6. โ
Added real-world use cases
7. โ
Added configuration section
8. โ
Added troubleshooting guide
9. โ
Added development tips
10. โ
Better organization and formatting
11. โ
More code examples
12. โ
Added jobs/commands examplesAll versions of apicall with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0
illuminate/auth Version ^8.0|^9.0|^10.0|^11.0