Category : forms

I created routes with type (POST), and when visit it directly, it get this error: The GET method is not supported for this route. Supported methods: POST. how to handle getting this error if anyone visit it from URL without press a form submit or something like that. the routes: Route::group([‘middleware’=>’guest:web’], function(){ Route::post(‘/post-login’, [LoginController::class,’postLogin’])->name(‘site.postLogin’); Route::post(‘/register-create’, ..

Read more

I have a form to edit and update certain values ​​of a student, like grade, scholarship, comments, etc. And I have a @foreach so that I can update each student one by one, but I want to change that, I want to send all data of all students at the end, not one by one. ..

Read more

I’m trying to update status. if status is 0 then on click it must update it to 1. but if status is 1 on click it must update it to 0. my controller public function status(Course $course) { if ($course->status == 0) { $course->update([‘status’ => ‘1’]); return redirect(‘/profile’)->with(‘statusOn’, ‘status on!’); } else { $course->update([‘status’ => ..

Read more

I have 2 different tables based on their types: User & Buyer. I am validating "buyers" data but it checks in the "users" table rather than in the "buyers" table, Is there any way to ask Validator Facade to check in the "buyers" table. $validator = Validator::make($request->all(), [ ‘name’ => ‘required’, ‘user_type’ => ‘required’, ‘phone’ ..

Read more

How can I make conditions for checkbox and get selected data in laravel? This my files.. please help me <form method="POST" action="{{route(‘sendjob’)}}"> <label class="block uppercase text-blueGray-600 text-xs font-bold mb-2" for="file">{{__(‘الوظائف ‘)}} </label> <input type="checkbox" name="check_list[]" value="1"> <label class="text-blueGray-600 text-xs font-bold mb-2 mr-2">مبرمج تطبيقات جوال </label> <br> <input type="checkbox" name="check_list[]" value="2"> <label class="text-blueGray-600 text-xs font-bold mb-2 ..

Read more

I am posting array of checkboxes of categories and can receive the array in Controller. Results are shown on the same page after form submission. I have to check the posted checkboxes. Below is my code for creating checkboxes @foreach($product_categories as $category) <div class="form-check collection-filter-checkbox"> <input type="checkbox" class="form-check-input" name="categories[{{$category[‘id’]}}]" value="{{$category[‘id’]}}" id="{{$category[‘id’]}}" /> <label class="form-check-label" for="{{$category[‘id’]}}">{{$category[‘name’]}}</label> ..

Read more

On localhost all is good, but when I deploy the application to the server not working. If form request validation fails instead of bringing me back to the same page and showing an error, it redirects me to the index page. config.blade.php <form method="POST" action="{{ route(‘config.update’, $config->id) }}"> @csrf @method(‘PUT’) <div class="form-group row"> <div class="col"> ..

Read more

I am new to Laravel. I am using registerController in Laravel to create users . Users data are stored in Users table. What I have tried is : @extends(‘adminlte::auth.auth-page’, [‘auth_type’ => ‘register’]) @php( $login_url = View::getSection(‘login_url’) ?? config(‘adminlte.login_url’, ‘login’) ) @php( $register_url = View::getSection(‘register_url’) ?? config(‘adminlte.register_url’, ‘register’) ) @if (config(‘adminlte.use_route_url’, false)) @php( $login_url = $login_url ..

Read more

I have a laravel application, for recruitment, and i want users(job recruiters) to create their own forms, the field title the input type (checkbox, radio button, textfield, date or image) So, the first job recruiter might create a form contains these questions: have you apllied before? type is radio button and options are yes/no attache ..

Read more

I have added this checkbox to my form: <div class="row"> <div class="form-group col"> <input type="checkbox" name="prd_presell" id="product_presell" onclick="presellTXT()" value="TRUE" @if(!empty($product)) @if($product->prd_presell == ‘TRUE’) checked @endif @endif> <label for="presell_product">Presell Product</label> </div> </div> So there is an onClick function named presellTXT() which goes like this: function presellTXT() { var presell_checkbox = document.getElementById("product_presell"); // get checkbox var presell_text ..

Read more

I have added this checkbox to my form: <div class="row"> <div class="form-group col"> <input type="checkbox" name="prd_presell" id="product_presell" onclick="presellTXT()" value="TRUE" @if(!empty($product)) @if($product->prd_presell == ‘TRUE’) checked @endif @endif> <label for="presell_product">Presell Product</label> </div> </div> So there an onClick function named presellTXT() goes like this: function presellTXT() { var presell_checkbox = document.getElementById("product_presell"); var presell_text = document.getElementById("show_presell_text"); if (presell_checkbox.checked == ..

Read more

I am new to laravel. I want to insert users data to database using registerController in laravel. What I have tried is: register.blade.php @extends(‘adminlte::auth.auth-page’, [‘auth_type’ => ‘register’]) @php( $login_url = View::getSection(‘login_url’) ?? config(‘adminlte.login_url’, ‘login’) ) @php( $register_url = View::getSection(‘register_url’) ?? config(‘adminlte.register_url’, ‘register’) ) @if (config(‘adminlte.use_route_url’, false)) @php( $login_url = $login_url ? route($login_url) : ” ) ..

Read more