<commit_before><?php

/*
 * This file is part of Hifone.
 *
 * (c) <EMAIL> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Hifone\Http\Controllers\Dashboard;

use AltThree\Validator\ValidationException;
use Hifone\Http\Controllers\Controller;
use Hifone\Models\Ad\Adblock;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\View;

class AdblockController extends Controller
{
    /**
     * Creates a new adblock controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        View::share([
            'current_menu' => 'adblocks',
            'sub_title'    => trans('dashboard.advertisements.advertisements'),
        ]);
    }

    /**
     * Shows the adblocks view.
     *
     * @return \Illuminate\View\View
     */
    public function index()
    {
        $adblocks = Adblock::orderBy('created_at', 'desc')->paginate(10);

        return View::make('dashboard.adblocks.index')
        ->withPageTitle(trans('dashboard.adblocks.adblocks').' - '.trans('dashboard.dashboard'))
        ->withAdblocks($adblocks);
    }

    /**
     * Shows an adblock in more detail.
     *
     * @param \Hifone\Models\\Ad\Adblock $adblock
     *
     * @return \Illuminate\View\View
     */
    public function show(Adblock $adblock)
    {
        $adspaces = $adblock->adspaces()->orderBy('order')->paginate(10);

        return View::make('dashboard.adspaces.index')
        ->withPageTitle(trans('dashboard.adspaces.adspaces').' - '.trans('dashboard.dashboard'))
        ->withAdspaces($adspaces);
    }

    /**
     * Shows the add adblock view.<commit_msg>Fix typo<commit_after><?php

/*
 * This file is part of Hifone.
 *
 * (c) <EMAIL> <h<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Hifone\Http\Controllers\Dashboard;

use AltThree\Validator\ValidationException;
use Hifone\Http\Controllers\Controller;
use Hifone\Models\Ad\Adblock;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\View;

class AdblockController extends Controller
{
    /**
     * Creates a new adblock controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        View::share([
            'current_menu' => 'adblocks',
            'sub_title'    => trans('dashboard.advertisements.advertisements'),
        ]);
    }

    /**
     * Shows the adblocks view.
     *
     * @return \Illuminate\View\View
     */
    public function index()
    {
        $adblocks = Adblock::orderBy('created_at', 'desc')->paginate(10);

        return View::make('dashboard.adblocks.index')
        ->withPageTitle(trans('dashboard.adblocks.adblocks').' - '.trans('dashboard.dashboard'))
        ->withAdblocks($adblocks);
    }

    /**
     * Shows an adblock in more detail.
     *
     * @param \Hifone\Models\Ad\Adblock $adblock
     *
     * @return \Illuminate\View\View
     */
    public function show(Adblock $adblock)
    {
        $adspaces = $adblock->adspaces()->orderBy('order')->paginate(10);

        return View::make('dashboard.adspaces.index')
        ->withPageTitle(trans('dashboard.adspaces.adspaces').' - '.trans('dashboard.dashboard'))
        ->withAdspaces($adspaces);
    }

    /**
     * Shows the add adblock view.
{'fraction_non_alphanumeric': 0.13839158851946576, 'fraction_numerical': 0.002273373117362887, 'mean_word_length': 2.7486687965921193, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, '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': '4435902', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1085, 'n_words': 214}