<?php

namespace App\DataTables;

use App\Models\Azienda;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Validation\Rule;
use Yajra\DataTables\DataTablesEditor;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Storage;

class AziendaDataTableEditor extends DataTablesEditor
{
  protected $model = Azienda::class;
  protected $uploadDir = '';
  protected $disk = 'azienda';
  protected $messages = [
    'ragione_sociale.required' => 'La ragione sociale è richiesta',
  ];

  /**
  * Get create action validation rules.
  *
  * @return array
  */
  public function createRules()
  {
    return [
      'ragione_sociale'  => 'required',
    ];
  }

  public function createMessages(){
    return $this->messages;
  }

  /**
  * Get edit action validation rules.
  *
  * @param Model $model
  * @return array
  */
  public function editRules(Model $model)
  {
    return [
      'ragione_sociale'  => 'required',
    ];
  }

  public function editMessages(){
    return $this->messages;
  }
  /**
  * Get remove action validation rules.
  *
  * @param Model $model
  * @return array
  */
  public function removeRules(Model $model)
  {
    return [];
  }


}
