PHP code example of tomatophp / filament-social

1. Go to this page and download the library: Download tomatophp/filament-social 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/ */

    

tomatophp / filament-social example snippets


->plugin(
    \TomatoPHP\FilamentSocial\FilamentSocialPlugin::make()
        ->socialLogin()
        ->socialRegister()
)

use TomatoPHP\FilamentSocial\Traits\InteractsWithSocials;

class User extends Authenticatable
{
    use InteractsWithSocials;
}

'twitter' => [
    'client_id' => env('TWITTER_CLIENT_ID'),
    'client_secret' => env('TWITTER_CLIENT_SECRET'),
    'client_token' => env('TWITTER_CLIENT_TOKEN'),
    'redirect' => env('TWITTER_REDIRECT_URI'),
],

'facebook' => [
    'client_id' => env('FACEBOOK_CLIENT_ID'),
    'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
    'redirect' => env('FACEBOOK_REDIRECT_URI'),
],

'discord' => [
    'client_id' => env('DISCORD_CLIENT_ID'),
    'client_secret' => env('DISCORD_CLIENT_SECRET'),
    'redirect' => env('DISCORD_URL'),
],

'snapchat' => [
    'client_id' => env('SNAPCHAT_CLIENT_ID'),
    'client_secret' => env('SNAPCHAT_CLIENT_SECRET'),
    'redirect' => env('SNAPCHAT_CALLBACK'),
],

'google' => [
    'client_id' => env('GOOGLE_CLIENT_ID'),
    'client_secret' => env('GOOGLE_CLIENT_SECRET'),
    'redirect' => env('GOOGLE_CALLBACK'),
],

'github' => [
    'client_id' => env('GITHUB_CLIENT_ID'),
    'client_secret' => env('GITHUB_CLIENT_SECRET'),
    'redirect' => env('GITHUB_URL'),
],

use TomatoPHP\FilamentSocial\Filament\Actions\SocialShareAction;

public function actions(): array
{
    return [
        SocialShareAction::make()
            ->inline()
            ->facebook()
            ->twitter()
            ->pinterest()
            ->reddit()
            ->telegram()
            ->whatsapp()
            ->linkedin()
            ->copy()
            ->print()
            ->mail()
    ];
}

$table->string('profile_photo_path', 2048)->nullable();
$table->string('email')->nullable()->change();
$table->string('username')->nullable()->unique();
bash
php artisan filament-social:install
bash
php artisan vendor:publish --tag="filament-social-config"
bash
php artisan vendor:publish --tag="filament-social-views"
bash
php artisan vendor:publish --tag="filament-social-lang"
bash
php artisan vendor:publish --tag="filament-social-migrations"