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
You can install the package via composer:
composer require joshcirre/laravel-appwrite
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.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.