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/ */
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
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.