| Conditions | 4 | 
| Paths | 4 | 
| Total Lines | 15 | 
| Code Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 0 | 
| CRAP Score | 20 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 16 | public function postAjax($attributes = [])  | 
            ||
| 17 |     { | 
            ||
| 18 |         if (! is_array($attributes)) { | 
            ||
| 19 | $attributes = ['url' => (string) $attributes];  | 
            ||
| 20 | }  | 
            ||
| 21 | |||
| 22 |         if (app()->bound('session') && $token = app('session')->token()) { | 
            ||
| 23 | $attributes = Arr::add($attributes, 'headers.X-CSRF-TOKEN', $token);  | 
            ||
| 24 | }  | 
            ||
| 25 | |||
| 26 | return $this->ajax(array_merge(  | 
            ||
| 27 | Arr::except($attributes, 'method'),  | 
            ||
| 28 | ['type' => 'POST']  | 
            ||
| 29 | ));  | 
            ||
| 30 | }  | 
            ||
| 31 | }  | 
            ||
| 32 |