-
const URL = <request url> const OPTIONS = { val1 : “test” } $dropdown = $(“#dropdown”); $.getJSON(URL,OPTIONS).done(function (data) { $.map(data, function (val,index) { $dropdown.append($(‘<option>’, { value: val.id, text: val.text })); }); $dropdown.val($promoter.find(‘option:eq(0)’).val()).trigger(“change”); }); If you have any problem implementing this. Let me know in the comments. Cheers & Happy coding.
-
It is tedious to use arrow keys to move cursor in/our from parenthesis always. you can add a custom key binding for that task. Go to preferences > key bindings and add following code { “keys”: [“ctrl+enter”], “command”: “move”, “args”: {“by”: “subword_ends”, “forward”: true} } Of course you can use some other key instead “ctrl+enter”…
-
How to get all dates between two given dates in PHP ? Recently i needed date string array for a project i am working on. Let me show you how i implemented that. After some digging on PHP documentation. I found there’s a special PHP class DatePeriod that can be used to implement that. Photo by…
-
Feathericons is a simple open source icon library. by default icon size is 24px. You can use following simple html template on a blank page if you are starting from scratch. <!DOCTYPE html> <html lang=”en”> <title></title> <script src=”https://unpkg.com/feather-icons”></script> <body> <!– example icon –> <i data-feather=”circle”></i> <script> feather.replace() </script> </body> </html> Or you can install using…
-
When you developing an API using laravel It is easier to debug api requests if you have a way to see api request and response parameters. We can simply do that using a middleware. You can create new middleware using artisan command php artisan make:middleware LogRequests And add below code to the file created. <?php…
-
Laravel mix is the default assets compilation package comes with laravel 5.4. It use webpack to compile assets. Using Mix you can define simple webpack build steps without going deep into webpack configrations. You can also use laravel mix in your other projects with some little tweaks. Your laravel installation should have following structure /webpack.mix.js…