Category : forms

i’m having a hard time figuring out how to validate children of an array, depending on the child itself. To get the Idea, i coded some wished behaviour to illustrate the problem with the required_if rule return $flight_data = $request->validate([ ‘flights.*.ac_call’ => ‘required|string’, ‘flights.*.ad_dep’ => ‘required|string’, ‘flights.*.ad_dest’ => ‘required|string’, ‘flights.*.dep_date’ => ‘required_if:flights.*.ad_dep,VALUE|date_format:d.m.Y’, ‘flights.*.dep_time’ => ‘required_if:flights.*.ad_dep,VALUE|date_format:H:i’, ..

Read more

Hy there! Im trying to create a user for my project. User.php – model <?php namespace AppModels; use IlluminateContractsAuthMustVerifyEmail; use IlluminateDatabaseEloquentFactoriesHasFactory; use IlluminateFoundationAuthUser as Authenticatable; use IlluminateNotificationsNotifiable; use LaravelSanctumHasApiTokens; class User extends Authenticatable { use HasApiTokens, HasFactory, Notifiable; /** * The attributes that are mass assignable. * * @var string[] */ protected $fillable = [ ..

Read more

register.blade.php <form class="" action="/register" method="post"> @csrf <div class="row"> <div class="col-12 col-sm-6"> <div class = "form-group"> <label for="firstname">First Name</label> <input type = "text" class="form-control" name="firstname" id="firstname" value="{{ old(‘firstname’) }}"> </div> </div> … <div class="row"> <div class="col-12 col-sm-4"> <button type="submit" class="btn btn-primary">Register</button> </div> <div class="col-12 col-sm-8 text-right"> <a href="/">Already have an account?</a> </div> </div> {!! csrf_field() !!} ..

Read more

I want to display my form like it is shown the below image- form-input image I have form input like this- <?= form_input([‘name’ => ’email_for_confirmation’, ‘id’ => ’email_for_confirmation’, ‘value’ => ”, ‘class’ => ‘form-control’, ‘placeholder’ => ‘Email’,’content’ =>”]) ?> <i class="form-icon fa fa-envelope-o"></i> I have tried content but it doesn’t work. Help would be appreciated. ..

Read more

I use Ckeditor 5 classic in textarea in Laravel Liveware, the form will not be submitted. How can I solve this problem? This form is bootstrap modal form. when i use ckeditor code in app.blade.php then the form are not submitted. ** Form Code** <form wire:submit.prevent="createAppointment"> <div class="modal-body"> <div class="form-group"> <label for="client_id">Client</label> <select wire:model.defer="state.client_id" id="client_id" ..

Read more

I have a table form input like this: <td> <ul style="list-style: none;" class="p-0 m-0"> @foreach($plan->festivalMembers->whereIn(‘fsm_role’, ‘author’) as $writer) <li> <input class="form-input" type="text" name="festival_authors[]" value="{{ $writer->user->member->mbr_name }}"> </li> @endforeach </ul> </td> So basically $plan->festivalMembers->whereIn(‘fsm_role’, ‘author’) retrieves more than one value and now I need to display them as a form value and then submit them by ..

Read more

I have a table and retrieved some data with this table at the Blade. Now I have added a checkbox as the first column of this table. <form method="POST" action="{{ route(‘finalFestival’) }}"> @csrf <table class="table table-sm table-bordered table-striped table-hover"> <thead class="thead-dark"> <tr> <th>Choose to pay</th> <th>Tracking Code</th> <th>Date of Submission</th> … </tr> </thead> <tbody> @foreach( ..

Read more

I’m creating a laravel web application and a dynamic form builder is required for the process. I need to add custom validation methods for each field and control visibility of child fields based on parent field values. Can you suggest a good plugin which allows me to build a dynamic form through the admin panel ..

Read more

I’m creating a laravel web application and a dynamic form builder is required for the process. I need to add custom validation methods for each field and control visibility of child fields based on parent field values. Can you suggest a good plugin which allows me to build a dynamic form through the admin panel ..

Read more

The file that I am generating is being returned in the response as a string instead of prompting the download. I’ve seen and tried a couple approaches to it from stackoverflow / other websites and they ultimately all resulted in the exact same problem. I’ve tried: Making a temp file, writing to it, then moving ..

Read more

I’m using Sweetalert.js for my project and I have added this to my document for showing a confirmation box: $(document).on(‘click’, ‘#btn-submit’, function(e) { e.preventDefault(); let form = $(this).parents(‘form’); swal( { title: "Attention!", text: "You are about to make a transaction", type: "warning", allowEscapeKey: false, allowOutsideClick: false, showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes", cancelButtonText: "No", showLoaderOnConfirm: ..

Read more

I have this very simple form in postscreate.blade.php <form action="http://example.com/posts" method="POST"> @csrf <input type="text" name="title"> <input type="submit" value="SUBMIT"> </form> and this route in web.php Route::resource(‘posts’,’PostController’); When I enter some text in the text input field named title and submit the form, it submits to the correct method [email protected] since a POST request to http://example.com/events leads ..

Read more

This is the strangest behaviour I have ever met with Laravel. So, I have a simple form with a textarea input like this: {!! Form::open([‘method’ => ‘post’, ‘route’ => $route, ‘class’ => ‘form-horizontal’, ‘enctype’ => ‘multipart/form-data’]) !!} <div class="form-group required"> {!! Form::label(‘html’, __(‘Content’), [‘class’ => ‘control-label col-sm-2 text-right’]) !!} <div class="col-sm-8"> <textarea name="html" id="html" class="form-control" ..

Read more

I am rebuilding a very old site I created, related to the history of the Holocaust. I have a form for a gallery to upload an image. There are two initial things it needs to know. Category Album I select the category first: @foreach ($gallery_categories as $gallery_category) <div> <label class="capitalize">{{ $gallery_category->name }}</label> <input type="radio" name="gallery_category_id" ..

Read more

I have a dropdown form that outputs an array taken from my controller Blade: <div class="form-group row"> <label for="action" class="col-sm-2 col-form-label">Action: </label> <div class="col-sm-4"> {!! Form::select(‘action’, $action, ‘all’, [‘class’ => ‘form-control’, ‘id’ => ‘action’]) !!} </div> </div> Controller: $action = [‘exclusion’ => ‘CRR Exclusion’, ‘auto-closure’ => ‘CRR Auto Closure’]; my Form::select uses $action in my ..

Read more