There is no license information available for the latest version (v1.3) of this package.

Blog for Airdev applications

v1.3 2021-08-17 09:25 UTC

This package is auto-updated.

Last update: 2022-06-17 11:10:02 UTC


A package that quickly provide blog system.

It's only working with Airdev web base project.


composer require airdev/blog

Next, add it to the Laravel's package providers in config/app.php

 * Package Service Providers...

Publish migrations, configure it if needed, the migrate.

php artisan vendor:publish --tag=airdev-blog-migrations
php artisan migrate

Publish the TiniMCE config file :

php artisan vendor:publish --provider="Kraftbit\NovaTinymce5Editor\FieldServiceProvider"

Add your TinyMCE cloud API key here or to your .env file like this :


Then, publish airdev/blog config file :

php artisan vendor:publish --tag=airdev-blog-config

You can now edit some configuration.

return [
    'user-nova-resource' => \App\Nova\User::class,
    'user-model' => \App\Models\User::class,
    // Preview url for posts
    // for exemple :
    'blog-preview-route' => '/blog',

    // Str::limit to shorten the intro text
    // If set to 'null', it will not short it
    'blog_intro_limit' => 200,


You can now access to blog ressources on Nova's Interface.

You can now create routes that will fetch the posts. Do not forget to create views.

Route::get('/blog', function() {
    // If no number of posts specified, it will take all posts
    return view('blog', ['posts' => AirdevPostController::get_posts(5)]);

Route::get('/blog/{slug}', function($slug) {
    $post = AirdevPostController::get_post_by_slug($slug);

    // Post doesn't exists
    if ($post == null)

    // Post exists but isn't active
    if (!$post->isPublishable)
        return redirect(route('blog'), 302);

    return view('post', ['post' => $post]);

Example for listing all available posts

@foreach ($posts as $post)
    <div class="col-4">
        <div class="card">
            <x-airdev-picture :media="$post->getFirstMedia('post_image')" slug="{{ $post->slug }}" class="card-img-top"></x-airdev-picture>
            <div class="card-body">
                <h3 class="card-title">{{ $post->title }}</h3>
                <div class="card-text">{{ $post->intro }}</div>
                <a href="{{ route('', $post->slug) }}">En savoir plus</a>