MrLukman

Experience

330

0 Best Reply Awards

  • Member Since 2 Weeks Ago
  • 0 Lessons Completed
  • 0 Favorites

22nd February, 2018

MrLukman left a reply on Submit Form With Time Limit • 1 day ago

@m-rk thank you pal, will definitely try it. :)

MrLukman left a reply on Submit Form With Time Limit • 1 day ago

Yes i want to protect it from spam bots and spammers, which way the best way to do it? Cache, cookies or database? And compare to captcha which one is more reliable? Thanks

MrLukman started a new conversation Submit Form With Limit • 1 day ago

hey guys i wanna ask, so i have a contact us form, and i want to set a limit, if the same user want to send another form they have to wait 3 minutes after the form they have submitted before. How can i do that? Thanks

11th February, 2018

MrLukman left a reply on Delete Warning • 1 week ago

@skliche thanks man that's really works, you're the real mvp. Btw fyi

i dont know why but in firefox i have to add this code

<script>
 var self = $(this);

//display swal
</script>

below event.preventdefault(); in order to make it work. But anyway thanks again :)

10th February, 2018

MrLukman left a reply on Delete Warning • 1 week ago

okay guys @Snapey @skliche so now i managed to display the warning, but when i press okay, the item is not deleted. here's my code.

<script>
 $('#delete').on('click', function(){
  event.preventDefault();
  swal("Are you sure?", {
   icon: "warning",
   dangerMode: true,
   buttons: true,
 }),
  function(){   
    $("#myform_id").submit();
  };

});
</script>

thanks again for the help

9th February, 2018

MrLukman left a reply on Delete Warning • 2 weeks ago

@ejdelmonico my problem is the warning just dont appear, when i press delete button the item just deleted right away, without even a warning. And my swal in other pages woks just fine, so i have to figure out how to trigger the warning first when i press the delete button. sorry for my bad english, and thanks again

MrLukman started a new conversation Delete Warning • 2 weeks ago

hey guys i wanna ask how to display a delete warning with sweet alert

here's my blade

 <form id="inbox" action ="{{ action('[email protected]', $inbox->id) }}" method="post">

                    {{csrf_field()}}
                    <input name = "_method" type="hidden" value="DELETE"/>
                    <button id ="delete" type = "submit" class = "btn btn-danger btn-xs" value= "Delete"/>
                      
                    </button>


<script>
 $('button.btn btn-danger btn-xs').on('click', function()
{

  // Display SweetAlert

   swal("Are you sure?", {
  icon: "warning",
  dangerMode: true,
  buttons: true,
}),

 //On clicking 'Yes, I am sure to delete'

 function(){  
      $(this).closest('#inbox').submit();
    }

}
   
</script>

the problem is when i press the delete button the item just deleted right away. thanks for the help

6th February, 2018

MrLukman left a reply on Markdown Mail • 2 weeks ago

@MikeHopley Thanks for the help man, its all good now. Your solution works like charm :)

MrLukman left a reply on Markdown Mail • 2 weeks ago

Thanks for the help man, its all good now. Your solution works like charm :)

MrLukman started a new conversation Markdown Mail • 2 weeks ago

Hey guys i wanna ask how to generate dynamic url for markdown mail. this is my markdown view.

Thank you {{$user->name}} for registered. We just need you to confirm your email.

@component('mail::button', ['url' => {{url('/verify')}}/{{$user->token}}/{{$user->id}} ])

{{-- <a class="btn btn-success" href="{{url('/verify')}}/{{$user->token}}/{{$user->id}}">I'm Human</a> --}}

Verify

@endcomponent

the url that i got is http://localhost/QLab-Mecmesin/(/verify)/(%24user-%3Etoken/%24user-%3Eid)

which supposed to be "http://localhost/QLab-Mecmesin/verify/{$user->token}/{$user->id}"

it works fine if i just use href and remove the email button component. But i want to use it on email button component instead of href. Thank you. im using Laravel 5.4

MrLukman left a reply on Use Name In URL Instead Of Id • 2 weeks ago

Thank you all that really solve the problem turns out my mistake was

public function show($id)
{
     $product = Product::find($id);

     return view('guest.productpage', compact('product'));
}

and all of you guys solution works like charm. :)

MrLukman left a reply on Use Name In URL Instead Of Id • 2 weeks ago

@rin4ik So in my model i have this

 public function getRouteKeyName()
{
    return 'product_name';
} 

in my routes.php i have this

Route::get('/product/{product}','function(App\Product $product)
{

dd($product);

});

and it works.

But i want to render the page using controller, how do i do that? because this doesn't work

Route::get('/product/{product}','guest\[email protected]',function(App\Product $product)
{
return view('guest.productpage')->name('product');

});

MrLukman left a reply on Use Name In URL Instead Of Id • 2 weeks ago

@rin4ik So in my model i have this public function getRouteKeyName() { return 'product_name'; }

in my routes.php i have this

Route::get('/product/{product}','function(App\Product $product) {

dd($product);

});

and it works.

But i want to render the page using controller, how do i do that? because this doesn't work

Route::get('/product/{product}','guest\[email protected]',function(App\Product $product) { return view('guest.productpage')->name('product');

});

5th February, 2018

MrLukman started a new conversation Use Name In URL Instead Of Id • 2 weeks ago

Hi there i wanna ask how to change my url from myproject/product/{id} to myproject/product/name.

The name ofc belongs to the ‘id’ it self. Thanks for the help :)

Edit Your Profile
Update

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