Skip to content

Instantly share code, notes, and snippets.

@DarkGhostHunter
Created July 29, 2020 21:02
Show Gist options
  • Save DarkGhostHunter/2e493a85ab0d56729980718a08f82f4a to your computer and use it in GitHub Desktop.
Save DarkGhostHunter/2e493a85ab0d56729980718a08f82f4a to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use App\Template;
class TemplateController extends Controller
{
/**
* Create a new contract.
*
* @param \Illuminate\Http\Request $request
* @return \App\Template
*/
public function create(Requets $request)
{
return Template::create($request->validate([
'text' => 'required|string',
'variables' => 'required|json',
'variables.*' => 'required|string'
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment