<commit_before><?php

namespace ZEDx\Http\Requests;

use Auth;

class CreateAdUserRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        $user = Auth::user();
        if (!$user->subscription_expired_at) {
            return true;
        }

        return $user->subscription_expired_at->diffInDays(null, false) < 0;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'content.title' => 'required|min:3',
            'content.body'  => 'required|min:3',
            'category_id'   => 'required|exists:categories,id',
        ];
    }
}<commit_msg>add ad content min max rules<commit_after><?php

namespace ZEDx\Http\Requests;

use Auth;

class CreateAdUserRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        $user = Auth::user();
        if (!$user->subscription_expired_at) {
            return true;
        }

        return $user->subscription_expired_at->diffInDays(null, false) < 0;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $setting = setting();

        return [
            'content.title' => 'required|min:3',
            'content.body'  => 'required|min:'.$setting->ad_descr_min.'|max:'.$setting->ad_descr_max,
            'category_id'   => 'required|exists:categories,id',
        ];
    }
}
{'fraction_non_alphanumeric': 0.12655233589591958, 'fraction_numerical': 0.0029568302779420462, 'mean_word_length': 2.026833631484794, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '3421301', 'n_tokens_mistral': 507, 'n_tokens_neox': 504, 'n_words': 117}