Category : forms

I am facing an issue while taking columns from the main table and pivot table. So I have two tables name: users and roles and a pivot table called role_user. here is the migration of users table: Schema::create(‘users’, function (Blueprint $table) { $table->engine = ‘InnoDB’; $table->id(); $table->string(‘name’); $table->string(’email’)->unique(); $table->timestamp(’email_verified_at’)->nullable(); $table->string(‘password’); $table->rememberToken(); $table->timestamps(); }); Here is ..

Read more

I have a words table and I want to keep a search form in my index view to search intended word. This is function that I have wrote for search in controller. public function search(string $id){ if($id!="") { $terms = Terms::query() ->where(‘term’, $id) ->get(); if(count($terms)==0) { $terms = Terms::query() ->where(‘term’, ‘LIKE’, "{$id}%") ->orWhere(‘term’, ‘LIKE’, "%{$id}%") ..

Read more

I have a words table and I want to keep a search form in my index view to search intended word. This is function that I have wrote for search in controller. public function search(string $id){ if($id!="") { $terms = Terms::query() ->where(‘term’, $id) ->get(); if(count($terms)==0) { $terms = Terms::query() ->where(‘term’, ‘LIKE’, "{$id}%") ->orWhere(‘term’, ‘LIKE’, "%{$id}%") ..

Read more

I want to show 1st form received data to 2nd form. How can i apply this process using laravel 5.8. Also here i can use laravel collection packages. /* ========= Routes ===========*/ Route::post(‘/subscribe/new’, ‘[email protected]’); /1st form Route::post(‘/subscribe/add’, ‘[email protected]’); /2nd form /* ========== 1st Form ============ */ {!! Form::open([‘url’ => ‘subscribe/new’, ‘method’ => ‘POST’]) !!} <input ..

Read more

I want to store all the selected check box values in single column separately like here is my code for that <tr> <th scope="row"> <input class="form-control" type="text" placeholder="Posts" readonly> </th> <td class="examplelink"> <input type="checkbox" name="checkPermission[]" value="Add"> </td> <td class="examplelink"> <input type="checkbox" name="checkPermission[]" value="View"> </td> <td class="examplelink"> <input type="checkbox" name="checkPermission[]" value="Edit"> </td> <td class="examplelink"> <input type="checkbox" ..

Read more

I have a problem, how do you add / remove a rule if another rule passed/fails? public function rules() { $rules = [ ‘description’ => ‘required|unique:orders,description’, ‘user_id’ => ‘required|unique:users,id’, ‘supplier_id’ => ‘required’, ‘warehouse_id’ => ‘required|unique:warehouse,id’, ‘warehouse_qty’ => ‘required’ ]; return $rules; } For example, if the "warehouse_id" rule fails, it would not be necessary to ..

Read more

I have a problem, how do you add / remove a rule if another rule passed/fails? public function rules() { $rules = [ ‘description’ => ‘required|unique:orders,description’, ‘user_id’ => ‘required|unique:users,id’, ‘supplier_id’ => ‘required’, ‘warehouse_id’ => ‘required|unique:warehouse,id’, ‘warehouse_qty’ => ‘required’ ]; return $rules; } For example, if the "warehouse_id" rule fails, it would not be necessary to ..

Read more

I’m developing a site in laravel. I have a view for editing and creating posts that brings the data stored from the database. For example: <input class="form-control" id="title" name ="title" type="text" value="@if($article != null){{$article->title}}@endif"> The problem is that when the user makes modifications, try to save the data and has validation errors, he loses all ..

Read more

i stack with livewire Update with checkbox array please help. Form <form wire:submit.prevent="Update" class="py-3 mb-6"> @foreach ($permissions as $key => $pms) <input type="checkbox" model:wire="PermissionCheckbox.{{ $key }}" {{ in_array($pms->id , $PermissionCheckbox)? "checked":"" }} /> @endforeach <button class="btn btn-primary" type="submit">Update</button> </form> Php Function public function Edit($id){ $role = Role::find($id); $this->roleId = $role->id; $this->roleName = $role->name; $this->PermissionCheckbox = ..

Read more