我收到此表单请求如下:
<?php
namespace App\Http\Requests;
use App\Sociallink;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class SociallinkRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'seq' => 'required|unique:sociallinks,seq,' . $this->id . ',id',
'social_name' => 'required|unique:sociallinks,social_name,' . $this->id . ',id',
'cssclass' => 'required',
'url' => …Run Code Online (Sandbox Code Playgroud)