laravel wink

If you are looking for a ready to use publishing solution for your Laravel based application, you should certainly have a look at Laravel Wink ! Whatever you need a blog, a quick website, or maybe both. Laravel Wink will help you integrate in your Laravel Project kind of Medium publishing experience without all the headache of WordPress.

Wink adds a nice UI where you can manage a publication of any size with posts, pages, tags, and authors. You can add photos, code blocks, featured images, social media & SEO attributes, embedded HTML (YouTube Videos, Embedded Podcasts Episodes, Tweets, …), and markdown! It is actually used to manage the official Laravel blog, Diving Laravel, among many others.

Laravel Wink

Getting started with Laravel Wink

Laravel Wink uses a separate database connection and authentication system so that you don’t have to modify any of your project code. But you can also have it running on the same database too. To install it, run these commands in the root of your Laravel app:

composer require themsaid/wink
php artisan wink:install
php artisan storage:link
php artisan wink:migrate

Installation will give you a default admin password to connect with. Notice that Laravel wink is simply for administrating your content, the solution doesn’t provide anything to display your content. So use Laravel and display them however you want.

Integrate Wink with S3

You can use Amazon S3 to store your images, in this case you have to configure your S3 account in the Wink configuration file. Of course you will need to install the AWS-S3 Flysystem adapter using composer require league/flysystem-aws-s3-v3 .

's3' => [
    'driver' => 's3',
    'key' => env('AWS_ACCESS_KEY_ID'),
    'secret' => env('AWS_SECRET_ACCESS_KEY'),
    'region' => env('AWS_DEFAULT_REGION'),
    'bucket' => env('AWS_BUCKET'),
    'url' => env('CDN_URL'),
    'options' => [
        'CacheControl' => 'public, max-age=315360000'
    ],
],

Displaying your content

As we mentioned previously since Laravel Wink is faceless, you can use the code below for example to display your content :

use Wink\WinkPost;

public function index()
{
    $posts = WinkPost::with('tags')
        ->live()
        ->orderBy('publish_date', 'DESC')
        ->simplePaginate(12);

    return view('blog.index', [
        'posts' => $posts
    ]);
}

You can use the wink models in your controllers to display the different resources:

  • Wink\WinkPost
  • Wink\WinkPage
  • Wink\WinkAuthor
  • Wink\WinkTag

To display posts and pages content, use $post->content instead of $post->body. The content will always be in HTML format while the body might be HTML or raw markdown based on the post type.

You can also integrate Wink with Unsplash to get millions of photos easily accessible from the platform. Laravel Wink is a good alternative for Laravel Developers to have a publishing solution ready to use right in their application. Laravel Wink is an open source library released under an MIT license. More information at https://github.com/themsaid/wink

LEAVE A REPLY

Please enter your comment!
Please enter your name here