public function templates($type)
    {
        $data      = [];
        $extension = $this->repository->findOrFail($type);
        foreach ($extension->param('templates') as $template) {
            $data[] = ['key' => $template['path'], 'value' => $template['description']];
        }

        return response()->json([
            'template' => $data[0]['key'],
            'selected' => $type,
            'data'     => $data,
        ], 200);
    }
public function templates($type)
    {
        $data      = [];
        $extension = $this->repository->findOrFail($type);
        foreach ($extension->param('templates') as $template) {
            $data[] = ['key' => $template['path'], 'value' => $template['description']];
        }

        return response()->json([
            'template' => $data[0]['key'],
            'selected' => $type,
            'data'     => $data,
        ], 200);
    }
public function templates ( $ type ) { $ data = [ ] ; $ extension = $ this -> repository -> findOrFail ( $ type ) ; foreach ( $ extension -> param ( 'templates' ) as $ template ) { $ data [ ] = [ 'key' => $ template [ 'path' ] , 'value' => $ template [ 'description' ] ] ; } return response ( ) -> json ( [ 'template' => $ data [ 0 ] [ 'key' ] , 'selected' => $ type , 'data' => $ data , ] , 200 ) ; }
Get all widget types.

@param string $type
@return string
Get all widget types .