PHP code example of laravelia / autoposter

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

    

laravelia / autoposter example snippets




return [
    'facebook' => [
        'APP_ID' => '',
        'APP_SECRET' => '',
        'PAGE_ACCESS_TOKEN' =>'',
        'FACEBOOK_PAGE_ID' => '',
        'ENABLE_FACEBOOK_PAGE_SHARE' => false,
    ],
    'tumblr' => [
        'CONSUMER_KEY' => '',
        'SECRET_KEY' => '',
        'TOKEN' => '',
        'TOKEN_SECRET' => '',
        'BLOG_NAME' => '',
        'ENABLE_TUMBLR_SHARE' => false
    ]
];


use App\Models\Post;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Laravelia\Autoposter\Services\SocialShareService as SocialShare;

class ExampleController extends Controller
{   
    public function storePost(Request $request, SocialShare $socialShare)
    {   
        $post = Post::create($request->all());

        $data = [
            'link' => $post->permalink, //your content link
            'title' => $post->title, //your content title
            'excerpt' => $post->excerpt, //your content short text
            'tags' => $post->tags, //your contect tags ex: test, test2, test3
            'attachment_url' => $post->attachment //your contect attachment link
        ];

        $socialShare->share($data);

        //continue with your code
    }