dimanche 13 octobre 2019

Laravel: After form submission showing unusual data

When I submit my form I'm getting unusual data/info for 1/2 second, like URL, CSRF, Browser Info, etc. (Please check screenshot or Attached video)

Can anyone please help me with this issue?

enter image description here

Here's the screen record video: https://d.pr/free/v/0gXEdo

Router:

Route::resource('categories', 'CategoryController');

Controller:

/**
 * Update the specified resource in storage.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \App\Category  $category
 * @return \Illuminate\Http\Response
 */
public function update(Request $request, Category $category)
{
    $category->update($request->validate([
        'name' => 'min:3|required',
        'slug' => 'min:3|required',
        'description' => ''
    ]));
    return $request.redirect('/categories');
}

Form/View:

@extends('layout.app')
@section('content')
    <div class="pt-5 pb-5">
        <div class="container">
            <form action="/categories/" method="POST">
                @method('PATCH')
                @csrf
                <h4>Edit Categories</h4>
                <div class="form-group">
                    <label for="name">Name</label>
                    <input type="text" value="" class="form-control" name="name" placeholder="Name">
                    <p class="text-muted pt-1"><i class="small">The name is how it appears on your site.</i></p>
                </div>
                <div class="form-group">
                    <label for="slug">Slug</label>
                    <input type="text" value="" class="form-control" name="slug" placeholder="Slug">
                    <p class="text-muted pt-1"><i class="small">The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.</i></p>
                </div>
                <div class="form-group">
                    <label for="description">Description (optional)</label>
                    <textarea name="description" class="form-control"></textarea>
                    <p class="text-muted pt-1"><i class="small">The description is not prominent by default; however, some themes may show it.</i></p>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary">Update category</button>
                </div>
            </form>
        </div>
    </div>
    </div>
@endsection


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2plpFta
via IFTTT

Aucun commentaire:

Enregistrer un commentaire