Download the PHP package zynqa/filament-freeagent without Composer

On this page you can find all versions of the php package zynqa/filament-freeagent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-freeagent

FreeAgent Integration for FilamentPHP

A comprehensive Laravel/FilamentPHP package that integrates FreeAgent accounting software into Filament applications. View and download FreeAgent invoices directly from your Filament admin panel with system-wide OAuth authentication and contact-based scoping.

Features

Requirements

Installation

1. Install via Composer

2. Publish and Run Migrations

This will publish and run:

3. Publish Configuration (Optional)

4. Add Trait to User Model

Add the HasFreeAgentContact trait to your User model:

5. Add FreeAgent Settings to GeneralSettings

Add FreeAgent fields to your app's GeneralSettings class:

6. Create Settings Migration

Then run: php artisan migrate

7. Add FreeAgent Section to General Settings Page

In your ManageGeneralSettings page, add the FreeAgent section to the Integrations tab:

Configuration

Option 1: UI Configuration (Recommended)

  1. Navigate to Settings → General Settings → Integrations
  2. Expand FreeAgent Integration section
  3. Enter your OAuth credentials and API URLs
  4. Click Save

Settings are stored in database and override .env values.

Option 2: Environment Variables

Add these to your .env file (used as fallback if UI not configured):

Configuration Priority:

  1. Database Settings (UI configured) ← Highest
  2. Environment Variables (.env)
  3. Default Values ← Lowest

FreeAgent OAuth App Setup

  1. Log into your FreeAgent account
  2. Go to Settings → Developer Dashboard
  3. Create a new OAuth application:
    • Name: Your Application Name
    • Redirect URI: https://yourapp.com/freeagent/callback
  4. Copy the Client ID and Client Secret

Usage

For Administrators

1. Configure OAuth Credentials

Settings → General Settings → Integrations → FreeAgent Integration

2. Connect FreeAgent (Admin-Only)

Settings → General Settings → Integrations → FreeAgent Integration

  1. Click "Connect FreeAgent" button
  2. Authorize access in FreeAgent OAuth flow
  3. You'll be redirected back
  4. Status changes to "Connected" ✅

Important: This creates a system-wide connection that all users share. Only admins can connect/disconnect.

3. Assign FreeAgent Contacts to Users

Users → Edit User → FreeAgent Tab

  1. Select the FreeAgent Contact from dropdown
  2. Save
  3. User will now see invoices for that contact only

Contact Assignment:

4. Disconnect FreeAgent (Admin-Only)

Settings → General Settings → Integrations → FreeAgent Integration

  1. Click "Disconnect FreeAgent" button
  2. Confirm in modal
  3. All users lose access to FreeAgent invoices

For Regular Users

View Invoices

  1. Navigate to Invoices in sidebar
  2. See invoices for your assigned contact only
  3. Use filters to find specific invoices
  4. Click "View" to see invoice details
  5. Click "Download PDF" to download invoice

Sync Invoices

  1. Click "Sync Invoices" button
  2. Confirm sync
  3. Latest invoices fetched from FreeAgent

Note: If not connected to a contact, you'll see:

"No Invoices Available - Your account is not yet linked to a FreeAgent contact. Please contact your administrator to set up access."

Authorization & Multi-Tenancy

Admin Access (super_admin role)

User Access (regular users)

Contact-Based Scoping

The package implements secure contact-based scoping:

Policy Implementation

Features in Detail

Invoice List

Columns:

Filters:

Actions:

Invoice Detail View

Sections:

Project Integration

Invoices automatically link to FreeAgent projects:

Date Format Integration

All dates use the app's configured format:

PDF Downloads

Secure PDF download with validation:

Caching & Sync Strategy

System-Wide Connection

The package uses a single OAuth connection (user_id = 1) shared by all users:

Automatic On-Access Sync

When a user visits the invoices page:

  1. Check if cache is stale (>30 minutes old)
  2. If stale, automatically sync in background
  3. Display fresh data to user
  4. No user interaction needed

Manual Sync

Users can click "Sync Invoices" to force a refresh:

Pagination

All API calls use full pagination:

API Services

FreeAgentService

Core service for FreeAgent API interactions:

FreeAgentOAuthService

System-wide OAuth token management:

Note: All methods now use system-wide token (user_id = 1) instead of per-user tokens.

FreeAgentCacheService

Sync and cache management:

Database Structure

Tables

freeagent_oauth_tokens

freeagent_contacts

freeagent_invoices

freeagent_projects

users (modified)

Relationships

Error Handling

OAuth Errors

API Errors

Logging

All errors are logged with context:

Security

Testing

Changelog

Recent Improvements

Roadmap

Troubleshooting

"Cannot assign Closure to property" Error

Solution: Clear cache after settings updates:

"No Invoices Available" Message

Causes:

  1. Admin hasn't connected FreeAgent
  2. User not linked to a FreeAgent contact
  3. No invoices for user's contact

Solution: Contact admin to link your account to a FreeAgent contact.

PDF Download Corrupted

This has been fixed! PDFs now properly decode from base64 and validate magic bytes.

Invoices Not Syncing

Check:

  1. FreeAgent connected in Settings
  2. OAuth token not expired (auto-refreshes)
  3. Check storage/logs/laravel.log for errors

Support

For issues, feature requests, or questions:

License

MIT License - see LICENSE file for details

Credits


All versions of filament-freeagent with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^3.2 || ^4.0 || ^5.0
spatie/laravel-settings Version ^3.0
spatie/laravel-package-tools Version ^1.16
illuminate/support Version ^11.28 || ^12.0 || ^13.0
guzzlehttp/guzzle Version ^7.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zynqa/filament-freeagent contains the following files

Loading the files please wait ...