davmixcool/laravel-medium-articles

Laravel Medium Articles is a laravel package that allows you to easily embed Medium.com articles on your site. Embed articles as standard post formats or as scrolling galleries. We are powered by mediumable.

dev-main 2022-01-10 22:57 UTC

This package is auto-updated.

Last update: 2024-11-11 05:53:50 UTC


README

Laravel Medium Articles is a laravel package that allows you to easily embed Medium.com articles on your site. This package is powered by Mediumable.

GitHub license GitHub issues

Features

  • Grid Post
  • Carousel Post
  • Lead Capture
  • Customization

Requirements

  • PHP 5.4 and above

Steps:

Install

Composer

Run the following to include this package via Composer

composer require davmixcool/laravel-medium-articles

Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Once download is complete, the next thing you have to do is include the service provider within config/app.php.

'providers' => [
        Davmixcool\Medium\MediumServiceProvider::class,
];

Then run php artisan vendor:publish --provider="Davmixcool\Medium\MediumServiceProvider" to get the config of Laravel Medium Articles.

Configuration

Setup default medium widget in medium.php config. (Optional but recommended)

Render options:

Layout customization options:

Customize the appearance of your widget.

Elements customization options:

Customize what your readers see.

Target customization options:

Choose the action you want to execute when a reader clicks on your article.

Usage

Once configuration is complete you can then add the below code where you want your articles to show;

@include('medium::widget')

The above will use the predefined configurations to prefill the generated widget. However, if you choose to define certain options on the fly or you choose to include multiple widgets on one page then you can use the code below.

@include('medium::widget', [
    'username' => 'iamdavidoti',
    'id'   => 27623742, //This id should be unique for each widget you include on a page.
])

You can alawys refer to the customization table to supply the customization parameters that you need to tweak.

Example

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
    </head>
    <body>
    	<div>
    		@include('medium::widget', [
			    'username' => 'iamdavidoti',
			    'id'   => 27623742,
			])
    	</div>
    </body>
    </html>

Maintainers

This package is maintained by David Oti and you!

License

This package is licensed under the MIT license.

Reference

This package is powered by Mediumable.