Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

kapitan

Experience

320

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 0 Lessons Completed
  • 0 Favorites

19th November, 2017

kapitan started a new conversation Parent - Child On The Same Table • 3 weeks ago

MAIN TABLE

id | parent_id | form_id | is_approved | fruit_id 1 | 0 | 1 | 1 | 1 2 | 1 | 2 | 1 | 2 3 | 0 | 1 | 1 | 3 4 | 3 | 2 | 0 | 4

FRUIT TABLE

id | name 1 | cherry 2 | guava 3 | apple 4 | grapes

by referencing on the Main Table, i need to output all fruit names from the Fruit Table for rows that has a:

1.) parent_id != 0 2.) is_approved=1

how to do this? please help!

11th November, 2017

kapitan left a reply on JS Function's Value Inside Looped Textbox • 1 month ago

got it:

'onkeyup' => 'readonly('.'"item_'.$i.'"'.');'

thanks!

kapitan started a new conversation JS Function's Value Inside Looped Textbox • 1 month ago

how to put the id inside my readonly function inside the loop on my view file?

@foreach ($assets as $asset) @php $i++; @endphp {{ Form::input('text', 'item_'.$i, $asset->item, ['id' => 'item_'.$i, 'placeholder' => 'Item', 'class' => 'form-control input-sm', 'onkeyup' => 'readonly();']) }}

@endforeach

thank you very much!

9th November, 2017

kapitan left a reply on Redirect Page Select Tag Onchange • 1 month ago

i knew now what i have missed, the "/" at the beginning. lesson learned.

kapitan left a reply on Redirect Page Select Tag Onchange • 1 month ago

it works! im sure, im doing this earlier. thank you so much. apologies for bothering you with a basic stuff. take care!

kapitan left a reply on Redirect Page Select Tag Onchange • 1 month ago

thank you, but i tried that but it the:

/register/business/1/edit

only append on my current url which is:

/register/business/create

so it is becomming:

http://localhost:8000/register/business/create/register/business/1/edit

which is an invalid url (page cannot be found)

i only want:

http://localhost:8000/register/business/1/edit

it's really weird.

kapitan started a new conversation Redirect Page Select Tag Onchange • 1 month ago

I have this route:

Route::get('/register/business/{id}/edit', '[email protected]')->name('register.edit.get');

on the home page, i have this select tag:

Form One Form Two Form Three

I need to redirect the page to my route name register.edit.get on the onchange event of my select tag.

please help!!!

5th November, 2017

kapitan left a reply on How To Return Variable From Form Request To Controller • 1 month ago

thank you sir Snapey, im crying, love you dude!

kapitan left a reply on How To Return Variable From Form Request To Controller • 1 month ago

or if you know how to redirect the form inside the App\Http\Requests\MyFormRequests.php to my register.edit.get route name with the myid value on it.

kapitan left a reply on How To Return Variable From Form Request To Controller • 1 month ago

I am saving a record on function persist() on Form Requests.

My goal is to pass the generated id so that I can redirect the page on edit mode for the user. For some reason, the Controller cannot receive the id from Form Requests.

App\Http\Requests\MyFormRequests.php:

function persist() { $business = Business::create([ 'business_name' => $this['business_name'], 'nationality' => $this['nationality'] ]);

return $myid = $business->id; } App\Http\Controllers\MyControllers.php:

public function store(MyFormRequests $request) { $request->persist();

return redirect()->route('register.edit.get', $request->persist()->$myid); }

kapitan started a new conversation How To Return Variable From Form Request To Controller • 1 month ago

How can I return a variable from Form Requests (App\Http\Requests) to Controller (App\Http\Controllers)?

Please help and thank you!

4th November, 2017

kapitan left a reply on Form Request = What Button Was Clicked • 1 month ago

tested and worked.

on saving, the application_form is required.

on updating, i put the value of the file name from database to is_application_form hidden field. so i only require the application_form field if the is_application_form hidden field is empty.

thanks so much!!!

kapitan started a new conversation Form Request = What Button Was Clicked • 1 month ago

I need to know which button was clicked inside a request form on laravel since i have Save and Update buttons.

App\Http\Requests\RegistrationRequest.php

public function rules() { $myrule = [ 'name' => 'required', 'age' => 'required' ];

if (isset($_POST['save']))
{
    $myrule['application_form'] = 'required';
}
elseif (isset($_POST['update']))
{
    $myrule['application_form'] = 'required_without:is_application_form';
}

return $myrule;

} i need to know if the button that was click is Save or Update because I'm requiring for the application_form file field to be required if the Save button is clicked but I only require the application_form field if the is_application_form hidden field is empty.

the setup above is working for name and age field but ignores the codes inside the IF conditions.

the thing is, this is working when placed inside the controller, just above the MyModel::create([]) code.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.