Question: I have this string where I need to extract only one word to put into a new columns.

```
HELLO WORLD TEST SHOES1 PROJECT

```

The required string is SHOES, but it has '1' beside it.

How can I extract the SHOES only?

Thank you

Answer: 
```
$("#franchise").change(function() {
    //alert( $( "#franchise" ).val() );
    var f = $( "#franchise" ).val();
    $.ajaxSetup({
      headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
      }
    });
    $.ajax({
      type: 'POST',
      url  : 'ajax/series',
      data : ({franchise : f}),
      dataType: 'JSON',
      success: function(response) {
        $("#series").html('');
        $("#series").append(response);
      }
    });
});

```
Your controller and route code are perfectly fine but your javaScript code has a little problem here, in laravel there is no need to add an ajax header field for CSRF token you can add CSRF token as the body of ajax like you have added franchise and the code will work absolutely fine.

I have written the code for you to give it a try.

```
    $('#franchise').change(function(e) {
        e.preventDefault();
        $.ajax({
            type: "POST",
            url: "{{ route('ajax.series') }}",
            data: {
                franchise: $(this).val(),
                _token: $('meta[name="csrf-token"]').attr('content'),
            },
            success: function(response) {
                $("#series").html('').append(response);
            }
        });
    });

```