joshcirre/laravel-appwrite

A helper package for the Appwrite PHP SDK.

dev-main 2024-02-09 21:45 UTC

This package is auto-updated.

Last update: 2024-04-09 22:11:19 UTC


README

Latest Version on Packagist Total Downloads

This package allows you to use the Appwrite PHP SDK as a Laravel Facade. While the Facade has current support for Databases, Account, and Storage, there are a lot of goals for this package in the near future.

A lot of inspiration will be taken from the Laravel MongoDB package in order to seamlessly integrate Appwrite and it's offerings into your Laravel application.

Plans for the Future:

  • Direct storage integration using the Laravel Storage facade
  • Model integration similar to Laravel MongoDB to create collections programmatically and then use the Model to access the data.
  • Laravel Breeze user authentication scaffold for Appwrite Accounts

Installation

You can install the package via composer:

composer require joshcirre/laravel-appwrite

Usage

After installation, you'll have global access to the LaravelAppwrite facade. This facade will allow you to access the Appwrite SDK anywhere in your application.

First, ensure that your .env variables are set:

APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
APPWRITE_PROJECT=projectId
APPWRITE_KEY=yourkey

Here's how the helper function would look in your Laravel application:

LaravelAppwrite::databases()->createDocument('65b56d9b46ba4fbb32d0', '65bc8de91b474a7627b5', $id, [
    'title' => $this->title,
    'description' => $this->description,
]);

LaravelAppwrite::account()

LaravelAppwrite::storage()

All of the methods available in the Appwrite API are available to the LaravelAppwrite:: facade.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email josh@cir.re instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.