Question: hello guys after mixing laravel template i have some problem with the jquery with Error: Bootstrap's JavaScript requires jQuery 

and after searcing im still confused whats happen can you help me 

here is my code : 

```
<script src="{{{ URL::asset('js/ace-extra.min.js')}}}"></script>
<script src="{{{ URL::asset('js/bootstrap.min.js')}}}"></script>
  <script src="{{{ URL::asset('js/ace-elements.min.js')}}}"></script>
  <script src="{{{ URL::asset('js/ace.min.js')}}}"></script>

```

`

and error on firefox :

[here](https://i.stack.imgur.com/AR0rD.png)

Answer: 
Here's a simple solution:

```
// array to store required strings
$stringsCollection = [];
// 4 is the number of strings that you need
while (sizeof($stringsCollection) != 4) {
    // generate new string
    $randString = random_string($length);
    // if string is not in `stringsCollection` - add it as a key
    if (!isset($stringsCollection[$randString])) {
        $stringsCollection[$randString] = 1;
    }
}
print_r(array_keys($stringsCollection));

```
> 
> or is there a more efficient way
> 
> 
> 

You are heading to "overengeneering land", trying to fix things you cannot even name :) Is it slow? Sluggish? Then profile and fix relevant parts. "Efficient" is buzzword w/o defining what efficiency means for you.

> 
> what is the best way to prevent duplicate outputs / collisions if called multiple times
> 
> 
> 

First, I'd use hashing functions with detailed (i.e. seconds or millis) timestamp + some mt\_rand as input like instead. It's limited in length but you can call it multiple times and concatenate results (+ trim if needed). And if you want to be 1000% the value was never returned before, you must keep track of them, however you most likely can **assume** this is not going to happen if you will have input string long enough