### Install Krayin Google Integration via Composer (Shell) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Installs the Krayin Google Integration package using Composer, downloading the necessary dependencies into the Krayin project. ```shell composer require krayin/krayin-google-integration ``` -------------------------------- ### Run Database Migrations for Google Integration (Shell) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Executes database migrations required by the Krayin Google Integration package to set up necessary tables or modify existing ones. ```shell php artisan migrate ``` -------------------------------- ### Publish Google Integration Vendor Assets (Shell) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Publishes configuration files, assets, and other resources from the Krayin Google Integration package to the main Krayin application directory, allowing customization. After running, search for GoogleServiceProvider and select it to publish its assets and configurations. ```shell php artisan vendor:publish --force ``` -------------------------------- ### Configure Google Vite Build Directory in Krayin (PHP) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Adds configuration for the Google Integration's Vite build process, specifying the hot file, build directory, and package assets directory within the Krayin Vite configuration. ```php [ // ... 'google' => [ 'hot_file' => 'google-vite.hot', 'build_directory' => 'google/build', 'package_assets_directory' => 'src/Resources/assets', ], ], ]; ``` -------------------------------- ### Configure Google Service Provider in Krayin (PHP) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Configures the Google service provider with API credentials, redirect/webhook URIs, required scopes (email, calendar), and OAuth options like approval_prompt and access_type. ```php return [ // ... 'google' => [ // Our Google API credentials. 'client_id' => env('GOOGLE_CLIENT_ID'), 'client_secret' => env('GOOGLE_CLIENT_SECRET'), // The URL to redirect to after the OAuth process. 'redirect_uri' => env('GOOGLE_REDIRECT_URI'), // The URL that listens to Google webhook notifications (Part 3). 'webhook_uri' => env('GOOGLE_WEBHOOK_URI'), // Let the user know what we will be using from his Google account. 'scopes' => [ // Getting access to the user's email. \Google_Service_Oauth2::USERINFO_EMAIL, // Managing the user's calendars and events. \Google_Service_Calendar::CALENDAR, ], // Enables automatic token refresh. 'approval_prompt' => 'force', 'access_type' => 'offline', // Enables incremental scopes (useful if in the future we need access to another type of data). 'include_granted_scopes' => true, ], ]; ``` -------------------------------- ### Configure Google API Credentials in .env (dotenv) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Adds environment variables for Google API client ID, client secret, and redirect/webhook URIs, which are essential for the Google OAuth and webhook processes. ```dotenv GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_REDIRECT_URI="${APP_URL}/google/oauth" GOOGLE_WEBHOOK_URI="${APP_URL}/google/webhook" ``` -------------------------------- ### Cache Krayin Configuration (Shell) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Caches the application configuration, improving performance by loading configuration values from a single file. ```shell php artisan config:cache ``` -------------------------------- ### Schedule Google Synchronization Jobs in Krayin (PHP) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Updates the Krayin console kernel's schedule function to include periodic and daily jobs for Google synchronization and webhook refresh tasks. ```php protected function schedule(Schedule $schedule) { $schedule->job(new \Webkul\Google\Jobs\PeriodicSynchronizations())->everyFifteenMinutes(); $schedule->job(new \Webkul\Google\Jobs\RefreshWebhookSynchronizations())->daily(); } ``` -------------------------------- ### Clear Krayin Application Cache (Shell) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Clears the entire application cache, which can resolve issues after configuration changes or updates. ```shell php artisan cache:clear ``` -------------------------------- ### Add Google Breadcrumbs in Krayin (PHP) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Adds breadcrumb definitions for Google Calendar and Google Meet creation pages within the Krayin application's navigation structure. Requires the davejamesmiller/laravel-breadcrumbs package. ```php Breadcrumbs::for('google.calendar.create', function (BreadcrumbTrail $trail) { $trail->parent('dashboard'); $trail->push(trans('google::app.calendar.index.title'), route('admin.google.index', ['route' => request('route')])); }); Breadcrumbs::for('google.meet.create', function (BreadcrumbTrail $trail) { $trail->parent('dashboard'); $trail->push(trans('google::app.meet.index.title'), route('admin.google.index', ['route' => request('route')])); }); ``` -------------------------------- ### Clear and Cache Krayin Routes (Shell) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Clears the existing route cache and regenerates it, improving route lookup performance after adding new routes from the Google Integration. ```shell php artisan route:cache ``` -------------------------------- ### Exclude Google Webhook from CSRF Verification (PHP) Source: https://github.com/krayin/krayin-google-integration/blob/master/README.md Adds the Google webhook URI to the $except array in the VerifyCsrfToken middleware, preventing CSRF token verification for incoming Google webhook requests. ```php protected $except = [ // ... 'google/webhook', ]; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.