Example #1
0
Route::get('mailjk', [function () {
    $user = [];
    $m = Mailgun::send('emails.focusGroup', $user, function ($message) {
        $message->to('*****@*****.**')->subject('Invitacion focus group Agrosellers');
        $message->tag('testGroupAgro');
        $message->from('*****@*****.**', 'Agrosellers');
        $message->trackOpens(true);
    });
    dd($m);
}, 'as' => 'sesiones']);
use Agrosellers\User;
Route::get('prueba', ['as' => 'elasticIndex', 'uses' => 'PositionAlgorithmController@index']);
use Illuminate\Http\Request;
use Agrosellers\Entities\Product;
Route::post('prueba', ['as' => 'elasticSearch', 'uses' => function (Request $request) {
    Product::addAllToIndex();
    $products = Product::search($request->name)->getDictionary();
    echo '<table>
                <thead>
                    <tr>
                        <th>Nombre</th>
                        <th>Descripcion</th>
                        <th>Precio</th>
                    </tr>       
                </thead>
                <tbody>
             ';
    foreach ($products as $product) {
        echo "<tr>\n                    <td>\n                        {$product->name}\n                    </td>\n                    <td>\n                        {$product->description}\n                    </td>\n                    <td>\n                        {$product->price}\n                    </td>\n                  </tr>";
    }
    echo '</tbody></table>';