user()->can('create', Listing::class); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'title' => 'string|required|max:100', 'description' => 'string|required|max:1000', 'condition' => ['nullable', Rule::in(['parts only', 'poor', 'fair', 'good', 'excellent'])], 'price' => 'decimal:2|gte:0', 'location' => 'string|nullable|max:50', ]; } }