Created
August 17, 2017 06:02
-
-
Save nickels/56f3df5adf836786d47600f543564bd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Illuminate\Support\Facades\Auth; | |
| use App\Http\Controllers\Controller; | |
| class SomeController extends Controller | |
| { | |
| public function store() | |
| { | |
| $timesheet = request()->validate([ | |
| 'date' => ['required', 'date', 'before_or_equal:' . \Carbon\Carbon::today()], | |
| 'records.*.project_id' => request()->sanitize('project_id', function ($projectId) { | |
| // ? | |
| }), | |
| ]); | |
| Auth::user()->timesheet()->save($timesheet); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment