Themosis framework release 2.0.1

The Themosis framework 2.0.1 has been released with a few minor fixes and a new console command for developers.

Updates

The minor release now provides a command to help developers scaffold Laravel Form validation request classes. Run the make:request command like so:

php console make:request UpdateBlogPost

Here are other updates provided by the release:

  • The can() method on a User instance accepts multiple arguments
  • On installation, the .env.sample file is now copied instead of being renamed

Fixes

  • Body class middleware now handles CSS classes provided with the body_class function
  • Add missing Domain Path theme header on installation
  • Correct the Twig meta helper. Users can also call the meta() function through PHP
  • Errors views can be handled within the active theme
  • Cleanup WordPress response headers on custom routes requests

Upgrade

If you’re already running a 2.0 application, you need to manually update your App\Http\Kernel class and add the new WordPressHeaders middleware to your web group in order to cleanup the reponse headers.

Here is a copy of the updated Kernel class with the added wp.headers middleware:

<?php

namespace App\Http;

use Themosis\Core\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
    /**
     * The application's global HTTP middleware stack.
     *
     * These middleware are run during every request to your application.
     *
     * @var array
     */
    protected $middleware = [];

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'admin' => [
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class
        ],
        'web' => [
            'wp.headers',
            'wp.bindings',
            'bindings',
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            'csrf',
            \Themosis\Route\Middleware\WordPressBodyClass::class
        ],
        'api' => [
            'throttle:60,1',
            'wp.can:edit_posts',
            'bindings'
        ]
    ];

    /**
     * The application's route middleware.
     * Aliased middleware. Can be used individually or within groups.
     *
     * @var array
     */
    protected $routeMiddleware = [
        'auth' => \App\Http\Middleware\Authenticate::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
        'csrf' => \App\Http\Middleware\VerifyCsrfToken::class,
        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
        'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
        'wp.bindings' => \Themosis\Route\Middleware\WordPressBindings::class,
        'wp.can' => \Themosis\Route\Middleware\WordPressAuthorize::class,
        'wp.headers' => \Themosis\Route\Middleware\WordPressHeaders::class
    ];
}

Also regarding theme translations, make sure to add the missing Domain Path: languages header in your active theme style.css file:

/*
Theme Name: Themosis
Theme URI: https://framework.themosis.com/
Author: Themosis
Author URI: https://www.themosis.com/
Description: The Themosis framework base theme.
Version: 2.0.0
License: GPL-2.0-or-later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: easy, organized, expressive.
Text Domain: themosis
Domain Path: languages
*/

Have some time to help the project ?

We’re also conducting a short survey regarding user experience with the Themosis framework. We would really appreciate your feedback and your help to get the word ouf of it. Please click on the link below to start fill in the survey, thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

Your email address will not be published. Required fields are marked *