<commit_before><?php

namespace SebastiaanLuca\Blog\Http\Routers;

use SebastiaanLuca\Blog\Http\Controllers\Admin\Auth\LoginController;
use SebastiaanLuca\Blog\Http\Controllers\Admin\PostController;
use SebastiaanLuca\Router\Routers\Router;

class AdminRouter extends Router
{
    /**
     * Map the routes.
     */
    public function map()
    {
        $this->mapAuthRoutes();
        
        $this->router->group(['prefix' => 'admin', 'as' => 'blog::admin.', 'middleware' => ['web', 'blog.auth']], function() {
            $this->router->get('/', [
                'as' => 'home', function() {
                    return redirect()->route('blog::admin.posts.index');
                }
            ]);
            
            $this->router->resource('posts', PostController::class);
        });
    }
    
    protected function mapAuthRoutes()
    {
        $this->router->group(['prefix' => 'admin', 'as' => 'blog::admin.', 'middleware' => ['web', 'blog.guest']], function() {
            $this->router->get('login', ['as' => 'auth.login', 'uses' => LoginController::class . '@showLoginForm']);
            $this->router->post('login', ['as' => 'auth.login.post', 'uses' => LoginController::class . '@login']);
            $this->router->post('logout', ['as' => 'auth.logout.post', 'uses' => LoginController::class . '@logout']);
        });
    }
}<commit_msg>Fix logout<commit_after><?php

namespace SebastiaanLuca\Blog\Http\Routers;

use SebastiaanLuca\Blog\Http\Controllers\Admin\Auth\LoginController;
use SebastiaanLuca\Blog\Http\Controllers\Admin\PostController;
use SebastiaanLuca\Router\Routers\Router;

class AdminRouter extends Router
{
    /**
     * Map the routes.
     */
    public function map()
    {
        $this->mapAuthRoutes();
        
        $this->router->group(['prefix' => 'admin', 'as' => 'blog::admin.', 'middleware' => ['web', 'blog.auth']], function() {
            $this->router->get('/', [
                'as' => 'home', function() {
                    return redirect()->route('blog::admin.posts.index');
                }
            ]);
            
            $this->router->resource('posts', PostController::class);
        });
    }
    
    /**
     * Map blog admin authentication routes.
     */
    protected function mapAuthRoutes()
    {
        $this->router->group(['prefix' => 'admin', 'as' => 'blog::admin.', 'middleware' => ['web', 'blog.guest']], function() {
            $this->router->get('login', ['as' => 'auth.login', 'uses' => LoginController::class . '@showLoginForm']);
            $this->router->post('login', ['as' => 'auth.login.post', 'uses' => LoginController::class . '@login']);
        });
        
        $this->router->group(['prefix' => 'admin', 'as' => 'blog::admin.', 'middleware' => ['web', 'blog.auth']], function() {
            $this->router->post('logout', ['as' => 'auth.logout.post', 'uses' => LoginController::class . '@logout']);
        });
    }
}
{'fraction_non_alphanumeric': 0.20972127804214818, 'fraction_numerical': 0.0, 'mean_word_length': 2.5500603136308806, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 66, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4101206', 'n_tokens_mistral': 890, 'n_tokens_neox': 882, 'n_words': 144}