MrLukman

Experience

610

0 Best Reply Awards

  • Member Since 6 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

27th June, 2018

MrLukman left a reply on Signature Pad • 1 month ago

@bashy thanks a lot man its all works now :)

26th June, 2018

MrLukman left a reply on Signature Pad • 1 month ago

@bashy i meant i already know how to save the signature that i draw, on that canvas. But my problem is i cant draw anything on that canvas. Thanks

MrLukman left a reply on Signature Pad • 1 month ago

https://imgur.com/FyEKOax

and this is the screenshot @bashy

MrLukman left a reply on Signature Pad • 1 month ago

@bashy here's the head section

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/signature_pad.min.js"></script>

and this is the body

 <div id="signature-pad" class="m-signature-pad">
    <div class="m-signature-pad--body">
        <canvas style="border: 2px dashed #ccc"></canvas>
    </div>

    <div class="m-signature-pad--footer">
        <button type="button" class="btn btn-sm btn-secondary" data-action="clear">Clear</button>
        <button type="button" class="btn btn-sm btn-primary" data-action="save">Save</button>
    </div>
</div>

<script>
    $(function () {
        var wrapper = document.getElementById("signature-pad"),
        clearButton = wrapper.querySelector("[data-action=clear]"),
        saveButton = wrapper.querySelector("[data-action=save]"),
        canvas = wrapper.querySelector("canvas"),
        signaturePad;

        // Adjust canvas coordinate space taking into account pixel ratio,
        // to make it look crisp on mobile devices.
        // This also causes canvas to be cleared.
        window.resizeCanvas = function () {
            var ratio =  window.devicePixelRatio || 1;
            canvas.width = canvas.offsetWidth * ratio;
            canvas.height = canvas.offsetHeight * ratio;
            canvas.getContext("2d").scale(ratio, ratio);
        }

        resizeCanvas();
    });
</script>

thanks

25th June, 2018

MrLukman left a reply on Signature Pad • 1 month ago

@bashy thanks for your help but it doesnt work, the window show up so does the clear and save button but i cant do anything there, its like the window is disable

MrLukman started a new conversation Signature Pad • 1 month ago

hello im kinda new to laravel i want to implement this package

https://github.com/szimek/signature_pad

can someone teach me how to show that signature form in blade? i alrd understand the part on how to save it. thanks

im using laravel 5.4

29th May, 2018

MrLukman left a reply on Send Notif Via WhatsApp • 2 months ago

thanks all for the help, gonna try 1 by 1

MrLukman started a new conversation Send Notif Via WhatsApp • 2 months ago

Hello i wanna ask does anybody knows how to send notifications via WhatsApp? I want a method similiar to markdown mail, but the notif will be send to WhatsApp instead of email. Thanks

Iam using laravel 5.4

28th May, 2018

MrLukman left a reply on Display Multiple Images • 2 months ago

thanks pal @lostdreamer_nl works like charm, also thanks for your advice

MrLukman started a new conversation Display Multiple Images • 2 months ago

so i have multiple images in one field like this: images/1D6iU0KI_vpl1.jpg;images/UXJk3kcG_vectorpro-mt-slide1.jpg

my problem is, i cant retrieve any of that image, (works fine if it just 1 image);

my controller

$service= new Service();
$imagesdata=null;
if($request->hasfile('Image'))
         {

            foreach($request->file('Image') as $image)
            {
                $name=str_random(8)."_".preg_replace('/\s+/','_',($image->getClientOriginalName()));

                $destination='images/';
                $image->move($destination, $name);  
                
                $fullpath = $destination.$name;
                $imagesdata .= $imagesdata == null ? $fullpath : ';' .$fullpath;
                 
                // $data[]=$name;
               
                
                
            }
             
             $service->image = $imagesdata;

         }

my blade

 @foreach($service->image as $images)
            <div class="row">
              <img src="{{URL::to('images/'.$images)}}">
            </div>
            @endforeach

ps

<img src="{{asset($service->image)}}">

doesnt work.

Thanks

26th March, 2018

MrLukman left a reply on Upload Laravel 5.4 To Shared Hosting • 4 months ago

thank you for the answer, all is fixed when i run php artisan config:clear and config:cache

25th March, 2018

MrLukman started a new conversation Upload Laravel 5.4 To Shared Hosting • 4 months ago

hi guys i wanna ask, i face problem said.

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

i already settings my .env to be the same with the database setting in cPanel. Thanks

22nd February, 2018

MrLukman left a reply on Submit Form With Time Limit • 5 months ago

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

MrLukman left a reply on Submit Form With Time Limit • 5 months 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 • 5 months 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 • 6 months 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 • 6 months 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 • 6 months 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 • 6 months 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 • 6 months ago

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

MrLukman left a reply on Markdown Mail • 6 months ago

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

MrLukman started a new conversation Markdown Mail • 6 months 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 • 6 months 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 • 6 months 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 • 6 months 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 • 6 months 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.