shaan
shaan
Explore posts from servers
TLCTuto's Laravel Corner
Created by shaan on 8/29/2023 in #🚀laravel
Fetch data from API and fill form
7 replies
TLCTuto's Laravel Corner
Created by shaan on 10/30/2023 in #💡filament
Old value after failed validation
oh, this is a old project. will start a filament one soon 😄
3 replies
TLCTuto's Laravel Corner
Created by shaan on 8/29/2023 in #🚀laravel
Fetch data from API and fill form
yes. Thank you so much for the help 🙂
7 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
No description
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
But the medicine
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
Its loading the amount correct
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
This is the edit form
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
@foreach($nebulization->medicineNebulizations as $medicine_used) <tr> <td class="pl-4 w-[45%] py-2"> <select id="medicine" name="medicine[]" class="font-thin text-sm w-full p-2 border border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"> @foreach( $medicines as $medicine ) <option value="{{ $medicine->id }}" @selected($medicine_used->id == $medicine->id)>{{ $medicine->name }}</option> @endforeach </select> </td> <td class="pl-4 w-[45%] py-2"> <input type="text" name="amount[]" value="{{ $medicine_used->amount }}" placeholder="eg: 5m l, 3 gm, 5 ltr" class="font-thin text-sm w-full p-2 border border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"> </td>
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
Not working
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
, how to load the old values from a dynamic input fields? here is the code.
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
var tr = `<tr class="pb-4">
<td class="pl-4 w-[45%] py-2">
<select id="medicine"
name="medicine[]"
class="font-thin text-sm w-full p-2 border border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm">
<option value="[]" selected disabled>Select a medicine</option>
@foreach( $medicines as $medicine )
<option value="{{ $medicine->id }}" {{ old("medicine.0") == $medicine->id ? 'selected' : '' }}> {{ $medicine->name }}</option>
@endforeach
</select>
</td>
<td class="pl-4 w-[45%] py-2">
<input type="text" name="amount[]" placeholder="eg: 5m l, 3 gm, 5 ltr" value="{{ old("amount.0") }}" class="font-thin text-sm w-full p-2 border rounded border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"></td>
<td>
<a href="javascript:void(0)" id="deleteRow"
class="">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-circle-minus text-rose-600" width="25" height="25" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path>
<path d="M9 12l6 0"></path>
</svg>
</a>
</td>
</tr>`;
var tr = `<tr class="pb-4">
<td class="pl-4 w-[45%] py-2">
<select id="medicine"
name="medicine[]"
class="font-thin text-sm w-full p-2 border border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm">
<option value="[]" selected disabled>Select a medicine</option>
@foreach( $medicines as $medicine )
<option value="{{ $medicine->id }}" {{ old("medicine.0") == $medicine->id ? 'selected' : '' }}> {{ $medicine->name }}</option>
@endforeach
</select>
</td>
<td class="pl-4 w-[45%] py-2">
<input type="text" name="amount[]" placeholder="eg: 5m l, 3 gm, 5 ltr" value="{{ old("amount.0") }}" class="font-thin text-sm w-full p-2 border rounded border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"></td>
<td>
<a href="javascript:void(0)" id="deleteRow"
class="">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-circle-minus text-rose-600" width="25" height="25" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path>
<path d="M9 12l6 0"></path>
</svg>
</a>
</td>
</tr>`;
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
```php
<tbody class="pb-8 pl-4">
<tr>
<td class="pl-4 w-[45%] py-2">
<select id="medicine"
name="medicine[]"
class="font-thin text-sm w-full p-2 border border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm">
<option value="" selected disabled>Select a medicine</option>

@foreach( $medicines as $medicine )
<option
value="{{ $medicine->id }}" {{ old("medicine.0") == $medicine->id ? 'selected' : '' }}>{{ $medicine->name }}</option>
@endforeach
</select>
</td>
<td class="pl-4 w-[45%] py-2">
<input type="text" name="amount[]" placeholder="eg: 5m l, 3 gm, 5 ltr"
value="{{ old("amount.0") }}"
class="font-thin text-sm w-full p-2 border border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm">
</td>
<td class="pl-4">
</td>
</tr>

</tbody>
```php
<tbody class="pb-8 pl-4">
<tr>
<td class="pl-4 w-[45%] py-2">
<select id="medicine"
name="medicine[]"
class="font-thin text-sm w-full p-2 border border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm">
<option value="" selected disabled>Select a medicine</option>

@foreach( $medicines as $medicine )
<option
value="{{ $medicine->id }}" {{ old("medicine.0") == $medicine->id ? 'selected' : '' }}>{{ $medicine->name }}</option>
@endforeach
</select>
</td>
<td class="pl-4 w-[45%] py-2">
<input type="text" name="amount[]" placeholder="eg: 5m l, 3 gm, 5 ltr"
value="{{ old("amount.0") }}"
class="font-thin text-sm w-full p-2 border border-gray-200 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm">
</td>
<td class="pl-4">
</td>
</tr>

</tbody>
14 replies
TLCTuto's Laravel Corner
Created by shaan on 10/6/2023 in #🚀laravel
n+1
Now the problem solved. But got more.
14 replies