Convert Figma logo to code with AI

themsaid logowink

A Laravel-based publishing platform

2,880
377
2,880
16

Top Related Projects

32,329

The Laravel Framework.

Associate users with roles and permissions

A package to backup your Laravel app

Manage Mailcoach and MailChimp newsletters in Laravel

Log activity inside your Laravel app

Making Eloquent models translatable

Quick Overview

Wink is a PHP library that provides a simple and intuitive way to create and manage webhooks. It allows developers to easily set up and handle incoming webhook requests, making it a useful tool for building integrations and automating workflows.

Pros

  • Simplicity: Wink offers a straightforward and easy-to-use API, making it accessible for developers of all skill levels.
  • Flexibility: The library supports a wide range of webhook providers, allowing developers to integrate with various services and platforms.
  • Robust Handling: Wink provides features for validating and processing incoming webhook requests, ensuring the integrity and security of the data.
  • Event-driven Architecture: The library's event-driven design allows for easy extensibility and customization, enabling developers to tailor the webhook handling to their specific needs.

Cons

  • Limited Documentation: The project's documentation could be more comprehensive, which may make it challenging for new users to get started.
  • Dependency on Laravel: Wink is primarily designed to work within the Laravel framework, which may limit its adoption by developers working with other PHP frameworks.
  • Lack of Community Engagement: The project's GitHub repository has relatively low activity, which could indicate a lack of active maintenance and community support.
  • Potential Performance Concerns: Depending on the complexity of the webhook handling, the library's performance may not be optimal for high-traffic applications.

Code Examples

Here are a few code examples demonstrating how to use Wink:

// Registering a new webhook
$wink = new \Themsaid\Wink\Wink();
$wink->register('my-webhook', function ($payload) {
    // Handle the incoming webhook payload
    // ...
});
// Validating an incoming webhook request
$wink = new \Themsaid\Wink\Wink();
$wink->validate('my-webhook', $request->all());
// Dispatching a webhook event
$wink = new \Themsaid\Wink\Wink();
$wink->dispatch('my-webhook', ['data' => 'example']);
// Handling a webhook event with middleware
Route::post('webhooks/my-webhook', '\Themsaid\Wink\Http\Controllers\WebhookController');

Getting Started

To get started with Wink, follow these steps:

  1. Install the library using Composer:
composer require themsaid/wink
  1. Register the Wink service provider in your application's config/app.php file:
'providers' => [
    // ...
    Themsaid\Wink\WinkServiceProvider::class,
],
  1. Publish the Wink configuration file:
php artisan vendor:publish --provider="Themsaid\Wink\WinkServiceProvider"
  1. Configure your webhook settings in the config/wink.php file.

  2. Register your webhooks in your application's service provider:

public function boot()
{
    $wink = new \Themsaid\Wink\Wink();
    $wink->register('my-webhook', function ($payload) {
        // Handle the incoming webhook payload
        // ...
    });
}
  1. Optionally, you can use the provided middleware to handle incoming webhook requests:
Route::post('webhooks/my-webhook', '\Themsaid\Wink\Http\Controllers\WebhookController');

That's it! You're now ready to start using Wink to manage your webhooks in your PHP application.

Competitor Comparisons

32,329

The Laravel Framework.

Pros of Laravel Framework

  • Comprehensive and well-documented, providing a robust set of features and tools for building web applications.
  • Extensive ecosystem of packages and libraries, making it easy to extend the framework's functionality.
  • Strong community support and active development, ensuring regular updates and improvements.

Cons of Laravel Framework

  • Larger codebase and learning curve compared to smaller, more focused frameworks like Wink.
  • May be overkill for smaller projects that don't require the full suite of features provided by the framework.

Code Comparison

Laravel Framework

Route::get('/', function () {
    return view('welcome');
});

Wink

Route::get('/', 'HomeController@index');

The main difference in the code snippets is the way routes are defined. Laravel uses a more declarative approach, while Wink uses a more traditional controller-based routing.

Associate users with roles and permissions

Pros of spatie/laravel-permission

  • Provides a simple and intuitive way to manage user permissions and roles within a Laravel application.
  • Supports multiple guard drivers, allowing for different authentication systems to be used.
  • Includes a comprehensive set of Artisan commands for managing permissions and roles.

Cons of spatie/laravel-permission

  • May require more boilerplate code to set up and integrate with an existing application.
  • Relies on the Eloquent ORM, which may not be suitable for all use cases.
  • Lacks some of the advanced features and customization options available in Wink.

Code Comparison

spatie/laravel-permission

// Assign a role to a user
$user->assignRole('writer');

// Check if a user has a specific permission
if ($user->can('edit articles')) {
    // ...
}

// Create a new permission
Permission::create(['name' => 'edit articles']);

themsaid/wink

// Create a new post
$post = Wink::posts()->create([
    'title' => 'My New Post',
    'content' => 'This is the content of my new post.',
]);

// Publish a post
$post->publish();

// Fetch all published posts
$posts = Wink::posts()->published()->get();

A package to backup your Laravel app

Pros of spatie/laravel-backup

  • Comprehensive backup solution for Laravel applications, supporting various storage options (local, S3, Dropbox, etc.)
  • Ability to schedule regular backups and monitor backup status
  • Supports database and file backups, as well as custom backup routines

Cons of spatie/laravel-backup

  • Slightly more complex configuration compared to Wink
  • May require additional setup for specific storage options

Code Comparison

Wink

public function store(Request $request)
{
    $this->validate($request, [
        'title' => 'required|string|max:255',
        'slug' => 'required|string|max:255|unique:posts',
        'content' => 'required|string',
        'published_at' => 'nullable|date',
    ]);

    $post = auth()->user()->posts()->create($request->all());

    return redirect()->route('wink.posts.index')
        ->with('success', 'Post created successfully.');
}

Laravel Backup

Backup::create([
    'name' => 'my-backup',
    'source' => [
        'files' => [
            base_path(),
        ],
    ],
    'destination' => [
        's3' => [
            'disk' => 's3',
            'path' => 'backups',
        ],
    ],
])->run();

Manage Mailcoach and MailChimp newsletters in Laravel

Pros of spatie/laravel-newsletter

  • Provides a simple and intuitive API for managing newsletter subscriptions and sending newsletters.
  • Supports multiple newsletter providers, including Mailchimp, Sendinblue, and Revue.
  • Includes features like double opt-in, unsubscribe handling, and email list segmentation.

Cons of spatie/laravel-newsletter

  • May have a steeper learning curve compared to Wink, especially for developers unfamiliar with the Spatie ecosystem.
  • Requires additional configuration and setup for integrating with different newsletter providers.

Code Comparison

Wink (themsaid/wink)

$post = Wink::post()->create([
    'title' => 'My First Post',
    'slug' => 'my-first-post',
    'content' => 'This is the content of my first post.',
    'published_at' => now(),
]);

Laravel Newsletter (spatie/laravel-newsletter)

Newsletter::subscribe('example@example.com', [
    'first_name' => 'John',
    'last_name' => 'Doe',
]);

Log activity inside your Laravel app

Pros of spatie/laravel-activitylog

  • Provides a simple and straightforward way to log user activities in a Laravel application.
  • Supports logging of various types of activities, including model changes, custom events, and more.
  • Offers a flexible and customizable logging system, allowing you to define your own activity models and log data.

Cons of spatie/laravel-activitylog

  • May require more setup and configuration compared to Wink, as it involves creating and managing activity models and migrations.
  • The learning curve may be slightly steeper for developers who are new to the Spatie ecosystem.
  • Depending on the complexity of your application, the activity log data may grow quickly, requiring additional maintenance and optimization.

Code Comparison

Here's a brief code comparison between spatie/laravel-activitylog and themsaid/wink:

spatie/laravel-activitylog:

use Spatie\Activitylog\Traits\LogsActivity;

class User extends Model
{
    use LogsActivity;

    protected static $logAttributes = ['name', 'email'];
}

themsaid/wink:

use Wink\WinkPost;

$post = WinkPost::find(1);
$post->title = 'New Title';
$post->save();

As you can see, spatie/laravel-activitylog requires you to define the attributes you want to log, while Wink automatically tracks changes to the model without any additional configuration.

Making Eloquent models translatable

Pros of spatie/laravel-translatable

  • Supports multiple translation models, allowing for more flexibility in your application's data structure.
  • Provides a simple and intuitive API for managing translations, making it easy to integrate into your Laravel project.
  • Includes built-in support for caching, which can improve the performance of your application.

Cons of spatie/laravel-translatable

  • May require more setup and configuration compared to Wink, as it needs to be integrated with your existing models.
  • Doesn't provide a built-in user interface for managing translations, which may require additional development effort.
  • Doesn't include the same level of content management features as Wink, such as the ability to manage posts, pages, and other content types.

Code Comparison

Wink (themsaid/wink):

public function store(Request $request)
{
    $post = Post::create([
        'title' => $request->title,
        'slug' => Str::slug($request->title),
        'content' => $request->content,
        'published_at' => $request->published_at,
    ]);

    return redirect()->route('wink.posts.index');
}

spatie/laravel-translatable:

public function store(Request $request)
{
    $post = new Post();
    $post->translateOrNew('en')->title = $request->title;
    $post->translateOrNew('en')->content = $request->content;
    $post->published_at = $request->published_at;
    $post->save();

    return redirect()->route('posts.index');
}

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

wink logo

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!

Wink is used to manage the official Laravel blog, divinglaravel.com, and many more.

Dark & Light modes available so everyone is happy 😁

Installation

Wink uses a separate database connection and authentication system so that you don't have to modify any of your project code.

To install Wink, run these commands in the root of your Laravel app:

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

Configure the database connection wink is going to be using in config/wink.php. Then run:

php artisan wink:migrate

Head to yourproject.test/wink and use the provided email and password to log in.

Uploading to S3

If you want to upload images to S3, update the storage_disk attribute in your wink.php configuration file to s3. Make sure your S3 disk is correctly configured in your filesystems.php configuration file.

'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'
    ],
],

Note: you're going to need to install the AWS-S3 Flysystem adapter, using composer require league/flysystem-aws-s3-v3 for this to work.

Using Unsplash

Visit https://unsplash.com/oauth/applications to create a new unsplash app. Grab the 'Access Key' and add it to your .env file as UNSPLASH_ACCESS_KEY. Lastly, add unsplash to your config/services.php file:

'unsplash' => [
    'key' => env('UNSPLASH_ACCESS_KEY'),
],

Updates

After each update, make sure you run these commands:

php artisan wink:migrate
php artisan vendor:publish --tag=wink-assets --force

Displaying your content

Wink is faceless, it doesn't have any opinions on how you display your content in your frontend. 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.

Credits

Special thanks to Caneco for the logo ✨

Contributing

Check the contribution guide.

License

Wink is open-sourced software licensed under the MIT license.