<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class SettingController extends Controller
{
    /**
     * @return \Illuminate\Http\Response
     */
    public function edit()
    {
        return view('setting.edit');
    }

    /**
     * @param  \Illuminate\Http\Request $request
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request)
    {
        $this->validate($request, [
            'start_at' => 'required|date',
            'end_at'   => 'required|date',
            'target'   => 'required|integer|min:0',
        ]);

        \Setting::set('start_at', $request->get('start_at'));
        \Setting::set('end_at', $request->get('end_at'));
        \Setting::set('target', $request->get('target'));

        \Setting::save();

        return redirect()->route('setting.edit')->with('global', '設定已更新');
    }
}

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class SettingController extends Controller
{
    /**
     * @return \Illuminate\Http\Response
     */
    public function edit()
    {
        return view('setting.edit');
    }

    /**
     * @param  \Illuminate\Http\Request $request
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request)
    {
        $this->validate($request, [
            'start_at' => 'required|date|before:end_at',
            'end_at'   => 'required|date|after:start_at',
            'target'   => 'required|integer|min:0',
        ]);

        \Setting::set('start_at', $request->get('start_at'));
        \Setting::set('end_at', $request->get('end_at'));
        \Setting::set('target', $request->get('target'));

        \Setting::save();

        return redirect()->route('setting.edit')->with('global', '設定已更新');
    }
}

Add missing checking rules of activity time
Add missing checking rules of activity time
