By Hardik Savani July 16, 2021 Category : LaravelPlayUnmuteLoaded: 0.17%FullscreenHi,
In this tutorial, i will show you laravel social media share buttons. I’m going to show you about social media share buttons laravel. We will look at example of how to add social media share buttons in laravel. if you have question about laravel social share buttons then i will give simple example with solution. Let's get started with jorenvanhocht laravel share example.
Here we will use jorenvanhocht/laravel-share composer package for adding social media sharing buttons in laravel project. you can easily use this example with laravel 6, laravel 7, laravel 8 and laravel 9. jorenvanhocht/laravel-share provide social sharing option for facebook, twitter, linkedin, telegram, whatsapp and reddit.
Let's see step by step bellow simple example and will get bellow layout:
Above command will create laravel-share.php config file on config folder and share.js in public/js/ folder.
Step 2: Create Route
In this is step we need to create some routes for social share example view.
routes/web.php
<?php use Illuminate\Support\Facades\Route; use App\Http\Controllers\SocialShareController; /*|--------------------------------------------------------------------------| Web Routes|--------------------------------------------------------------------------|| Here is where you can register web routes for your application. These| routes are loaded by the RouteServiceProvider within a group which| contains the "web" middleware group. Now create something great!|*/Route::get('social-share', [SocialShareController::class, 'index']);