# Web development

# Laravel

supervisor

[https://laravel.com/docs/5.4/queues#supervisor-configuration](https://laravel.com/docs/5.4/queues#supervisor-configuration)

Generate random string:

```lang-php
<?php

use Illuminate\Support\Str;

$id = Str::random(9);
```

Source:

[https://stackoverflow.com/questions/58152743/how-i-can-generate-the-unique-id-in-laravel](https://stackoverflow.com/questions/58152743/how-i-can-generate-the-unique-id-in-laravel)

# jQuery

Select2

Getting select2 values programmatically:

$(<span class="hljs-string">'#mySelect2'</span>).val(<span class="hljs-string">'1'</span>); <span class="hljs-comment">// Select the option with a value of '1'</span> $(<span class="hljs-string">'#mySelect2'</span>).trigger(<span class="hljs-string">'change'</span>); <span class="hljs-comment">// Notify any JS components that the value changed</span>

[https://select2.org/programmatic-control/add-select-clear-items](https://select2.org/programmatic-control/add-select-clear-items)