Commit ad17b59d by Triyah Fatmawati

Validasi script

parent 578b8cd4
......@@ -79,7 +79,8 @@ class AgendaController extends Controller
*/
public function store(Request $request)
{
// $request['content'] = strip_tags($request->content);
$request['content'] = strip_tags($request->content);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
'content' => 'required|min:3',
......@@ -248,11 +249,16 @@ class AgendaController extends Controller
*/
public function update(Request $request, $id)
{
// $request['content'] = strip_tags($request->content);
// $request['content_en'] = strip_tags($request->content_en);
// $request['content_de'] = strip_tags($request->content_de);
// $request['content_sa'] = strip_tags($request->content_sa);
// $request['content_zh'] = strip_tags($request->content_zh);
$request['content'] = strip_tags($request->content);
$request['content_en'] = strip_tags($request->content_en);
$request['content_de'] = strip_tags($request->content_de);
$request['content_sa'] = strip_tags($request->content_sa);
$request['content_zh'] = strip_tags($request->content_zh);
// $request['title'] = strip_tags($request->title);
// $request['title_en'] = strip_tags($request->title_en);
// $request['title_de'] = strip_tags($request->title_de);
// $request['title_sa'] = strip_tags($request->title_sa);
// $request['title_zh'] = strip_tags($request->title_zh);
$request->validate([
'title' => 'required',
......
......@@ -80,6 +80,7 @@ class InformationController extends Controller
public function store(Request $request)
{
$request['content'] = strip_tags($request->content);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
'content' => 'required|min:3',
......@@ -246,11 +247,16 @@ class InformationController extends Controller
*/
public function update(Request $request, $id)
{
// $request['content'] = strip_tags($request->content);
// $request['content_en'] = strip_tags($request->content_en);
// $request['content_de'] = strip_tags($request->content_de);
// $request['content_sa'] = strip_tags($request->content_sa);
// $request['content_zh'] = strip_tags($request->content_zh);
$request['content'] = strip_tags($request->content);
$request['content_en'] = strip_tags($request->content_en);
$request['content_de'] = strip_tags($request->content_de);
$request['content_sa'] = strip_tags($request->content_sa);
$request['content_zh'] = strip_tags($request->content_zh);
// $request['title'] = strip_tags($request->title);
// $request['title_en'] = strip_tags($request->title_en);
// $request['title_de'] = strip_tags($request->title_de);
// $request['title_sa'] = strip_tags($request->title_sa);
// $request['title_zh'] = strip_tags($request->title_zh);
$request->validate([
'title' => 'required',
......
......@@ -80,7 +80,8 @@ class PageController extends Controller
public function store(Request $request)
{
// dd($request);
// $request['content'] = strip_tags($request->content);
$request['content'] = strip_tags($request->content);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
'content' => 'required|min:3',
......@@ -245,11 +246,16 @@ class PageController extends Controller
public function update(Request $request, $id)
{
// dd($request);
// $request['content'] = strip_tags($request->content);
// $request['content_en'] = strip_tags($request->content_en);
// $request['content_de'] = strip_tags($request->content_de);
// $request['content_sa'] = strip_tags($request->content_sa);
// $request['content_zh'] = strip_tags($request->content_zh);
$request['content'] = strip_tags($request->content);
$request['content_en'] = strip_tags($request->content_en);
$request['content_de'] = strip_tags($request->content_de);
$request['content_sa'] = strip_tags($request->content_sa);
$request['content_zh'] = strip_tags($request->content_zh);
// $request['title'] = strip_tags($request->title);
// $request['title_en'] = strip_tags($request->title_en);
// $request['title_en'] = strip_tags($request->title_de);
// $request['title_en'] = strip_tags($request->title_sa);
// $request['title_en'] = strip_tags($request->title_zh);
$request->validate([
'title' => 'required',
......
......@@ -89,7 +89,8 @@ class PostController extends Controller
public function store(Request $request)
{
// dd($request);
// $request['content'] = strip_tags($request->content);
$request['content'] = strip_tags($request->content);
$request['title'] = strip_tags($request->title);
$request->validate([
'title' => 'required',
'categories' => 'required',
......@@ -355,11 +356,16 @@ class PostController extends Controller
*/
public function update(Request $request, $id)
{
// $request['content'] = strip_tags($request->content);
// $request['content_en'] = strip_tags($request->content_en);
// $request['content_de'] = strip_tags($request->content_de);
// $request['content_sa'] = strip_tags($request->content_sa);
// $request['content_zh'] = strip_tags($request->content_zh);
$request['content'] = strip_tags($request->content);
// $request['title'] = strip_tags($request->title);
$request['content_en'] = strip_tags($request->content_en);
$request['content_de'] = strip_tags($request->content_de);
$request['content_sa'] = strip_tags($request->content_sa);
$request['content_zh'] = strip_tags($request->content_zh);
// $request['title'] = strip_tags($request->title_en);
// $request['title'] = strip_tags($request->title_de);
// $request['title'] = strip_tags($request->title_sa);
// $request['title'] = strip_tags($request->title_zh);
$request->validate([
'title' => 'required',
......@@ -367,7 +373,7 @@ class PostController extends Controller
'content' => 'required|min:3',
'post_date' => 'required',
'keys' => 'max:100',
'thumbnail' => 'required|mimes:jpg,jpeg,png|max : 3072'
'thumbnail' => 'mimes:jpg,jpeg,png|max : 3072'
], [
'title.required' => 'Judul wajib diisi',
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment