OwlCyberSecurity - MANAGER
Edit File: StoreAddRequest.php
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class StoreAddRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array|string> */ public function rules(): array { $rules = [ 'title' => 'required|max:255', 'short_name' => 'required|max:180', 'slug' => 'required|max:255|unique:stores', 'url' => 'required|max:255', 'destination_url' => 'required', 'category' => 'required|integer|min:1', 'network' => 'required|integer|min:1', 'description' => 'required', // 'long_description' => 'required', 'meta_title' => 'max:55', 'meta_description' => 'max:150' ]; if(request()->hasFile('image')){ $rules['image'] = 'mimes:jpeg,jpg,png,webp|max:10240'; } if(request()->hasFile('og_image')){ $rules['og_image'] = 'mimes:jpeg,jpg,png,webp|max:10240'; } return $rules; } }