1. Go to this page and download the library: Download mirafive/sdk-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mirafive / sdk-laravel example snippets
use MiraFive\Laravel\Facades\Mira;
public function store(Request $request)
{
$user = User::create($request->validated());
Mira::track('signup', userId: (string) $user->id, properties: ['plan' => $user->plan]);
return redirect()->route('dashboard');
}
use Illuminate\Auth\Events\Login;
use Illuminate\Support\Facades\Event;
use MiraFive\Laravel\Facades\Mira;
// AppServiceProvider::boot()
Event::listen(Login::class, fn (Login $event) => Mira::forUser($event->user)->identify(['plan' => $event->user->plan]));