Delete action is not working in laravel? - php

I have a form which has the delete button in it.
<form method="post" id="delform" action="{{ url('/templates/delete',[$template->template_id]) }}">
{{ method_field('DELETE') }}
{{ csrf_field() }}
<input type="submit" class="btn btn-danger" id="del" value="delete>
</form>
then in my routes web.php:
Route::delete('/templates/delete/{id}','TemplateController#delete');
when i click on delete i get this error:
what am i doing wong please help? thanks in advance
I have added my composer.json here:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"maatwebsite/excel": "~2.1.0" "rmccue/requests": ">=1.0" },
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}
here is the console logs:

You forgot double-quotes to close value from input submit
<input type="submit" ... value="delete">
and a comma in composer json after package:
"maatwebsite/excel": "~2.1.0",
Finally HTML forms do not support PUT, PATCH or DELETE actions. So, when defining PUT, PATCH or DELETE routes that are called from an HTML form, you will need to add a hidden _method field to the form. The value sent with the _method field will be used as the HTTP request method.
<input type="hidden" name="_method" value="DELETE">
You may use the method_field helper to generate the _method input:
{{ method_field('DELETE') }}
Laravel routes documentation
Look at rest conventions

Related

laravel request file return null

this question have been asked many times before, I've tried all the solutions but nothing work with me
"laravel/framework": "^6.0",
//-----
<form action="post_customer_data" id="editform" method="POST" class="form-horizontal" enctype="multipart/form-data">
<input id="logo" type="file" name="logo" class="form-control form-control-lg">
dd($request->file('logo')); //Return Null!!!
in controller i use all the required packages
use Storage;
use File;
use Intervention\Image\Facades\Image;
use Illuminate\Http\Request;
What are the result if you print all the request data? Something like that:
dd($request->all());

Send data via POST to API and show response in PHP

I have a little problem, I am somewhat new to PHP and I can't get something to work.
I will explain.
I have access to a shipping API (Parcel), it gives me the possibility to track the packages by means of a guide number or a shipping ID and it returns the response in JSON with the status of the shipment.
I have made a small script that performs the tracing functions but I can't get it to show me neither the "main" status nor the "sub-events".
The request is sent via POST and the response looks like this:
{
"status": "SUCCESS",
"enviaya_shipment_number": "N9T30TAC",
"carrier_tracking_number": "9878401142",
"channel": "Api",
"estimated_delivery_date": null,
"expected_delivery_date": "12/01/2022",
"pickup_date": "2021-12-30T10:39:11-06:00",
"shipment_status": "En tránsito",
"event_code": 151,
"event_description": "Llegada al Centro de DHL",
"event": "Llegada",
"status_code": 14,
"sub_event_code": null,
"sub_event": null,
"sub_event_description": null,
"checkpoints": [
{
"code": "PU",
"description": "Envío recibido",
"date": "2022-01-03T12:12:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "MEXICO CITY-MEX"
},
{
"code": "PL",
"description": "Procesado",
"date": "2022-01-03T14:07:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "MEXICO CITY-MEX"
},
{
"code": "DF",
"description": "Salida",
"date": "2022-01-03T14:08:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "MEXICO CITY-MEX"
},
{
"code": "AF",
"description": "Llegada",
"date": "2022-01-03T15:30:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "MEXICO CITY HUB-MEX"
},
{
"code": "PL",
"description": "Procesado",
"date": "2022-01-03T18:55:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "MEXICO CITY HUB-MEX"
},
{
"code": "DF",
"description": "Salida",
"date": "2022-01-03T19:04:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "MEXICO CITY HUB-MEX"
},
{
"code": "AF",
"description": "Llegada",
"date": "2022-01-03T20:55:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "QUERETARO-MEX"
},
{
"code": "PL",
"description": "Procesado",
"date": "2022-01-03T22:03:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "QUERETARO-MEX"
},
{
"code": "DF",
"description": "Salida",
"date": "2022-01-03T22:31:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "QUERETARO-MEX"
},
{
"code": "AR",
"description": "Llegada",
"date": "2022-01-04T01:52:00.000-06:00",
"postal_code": null,
"city": null,
"country_code": null,
"country": null,
"comments": "MERIDA-MEX"
}
]
}
So I made a form in HTML for the client to send the data, it is something very simple:
<form action="track.php" method="post" enctype="multipart/form-data" accept-charset="UTF-8" id="form-app">
<fieldset class="row">
<!-- Heading -->
<div class="col-xs-12">
<h3 class="legend">Rastreo de Paquetes</h3>
</div>
<!-- Select List -->
<div class="col-xs-12">
<div class="form-group required-control">
<label class="control-label" for="carrier">Paquetería</label>
<select id="carrier" name="carrier" data-alias="" class="form-control" required >
<option value="UPS" >UPS</option>
<option value="Redpack" >Redpack</option>
<option value="Estafeta" >Estafeta</option>
<option value="DHL" >DHL</option>
<option value="99 Minutos" >99 Minutos</option>
<option value="FedEx" >FedEx</option>
<option value="iVoy" >iVoy</option>
</select>
</div>
</div>
<!-- Number -->
<div class="col-xs-12">
<div class="form-group required-control">
<label class="control-label" for="number">Número de guía o ID de Envío</label>
<input type="text" id="shipment" name="shipment" value="" data-alias="" data-integer-only="true" class="form-control" required>
</div>
</div>
<!-- Button -->
<div class="col-xs-12">
<div class="form-action">
<button type="submit" id="button_1" name="button_1" class="btn btn-primary">Enviar</button>
</div>
</div>
This in turn sends to the file that in theory connects with the API through cURL sending the data, receiving the response and decoding the JSON
<?php
include_once "key.php";
$shipment_number=$_POST["shipment"];
$carrier=$_POST["carrier"];
//SEND REQUEST post TO api AND DECODE JSON RESPONSE
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://envios.corporativomarva.mx/api/v1/trackings");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "carrier=".$carrier."&shipment_number=".$shipment_number);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"api_key: ".$API_KEY
));
$response = curl_exec($ch);
curl_close($ch);
$respuesta = json_decode($response);
//Show the response on HTML format with tables
echo "<table border='1'>";
echo "<tr><td>Estado del Envío</td><td>".$respuesta->shipment_status."</td></tr>";
echo "<tr><td>Evento</td><td>".$respuesta->event_description."</td></tr>";
echo "<tr><td>Guía</td><td>".$respuesta->carrier_tracking_number."</td></tr>";
echo "<tr><td>ID de Envio</td><td>".$respuesta->enviaya_shipment_number."</td></tr>";
echo "<tr><td>Fecha de envio</td><td>".$respuesta->pickup_date."</td></tr>";
//Show subevents on HTML format with tables
echo "<table border='1'>";
echo "<tr><td>Evento</td><td>Descripción</td><td>Fecha</td></tr>";
foreach ($respuesta->subevents as $subevent) {
echo "<tr><td>".$subevent->event."</td><td>".$subevent->description."</td><td>".$subevent->date."</td></tr>";
}
echo "</table>";
However, something is obviously wrong since it shows me empty cells, that is, it does not show any data.
According to the var_dump($respuesta); The API key is incorrect but I already verified and it is fine.
I have managed to find the answer:
First I passed the API key as a header and it had to be passed as one more parameter, and then I managed to make it show me the checkpoints in a table, the complete code is:
<?php
include_once "key.php";
$shipment_number=$_POST["shipment"];
$carrier=$_POST["carrier"];
$params = array(
"api_key" => $API_KEY,
"carrier" => $carrier,
"shipment_number" => $shipment_number
);
$headers = array(
"api_key=".$API_KEY
);
curl_setopt_array($ch = curl_init(), array(
CURLOPT_URL => "https://envios.corporativomarva.mx/api/v1/trackings",
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => http_build_query($params),
CURLOPT_RETURNTRANSFER => 1
));
$response = curl_exec($ch);
curl_close($ch);
$respuesta = json_decode($response);
//Show the response on HTML format with tables
echo "<table border='1'>";
echo "<tr><td>Estado del Envío</td><td>".$respuesta->shipment_status."</td></tr>";
echo "<tr><td>Evento</td><td>".$respuesta->event_description."</td></tr>";
echo "<tr><td>Guía</td><td>".$respuesta->carrier_tracking_number."</td></tr>";
echo "<tr><td>ID de Envio</td><td>".$respuesta->enviaya_shipment_number."</td></tr>";
echo "<tr><td>Fecha de envio</td><td>".$respuesta->pickup_date."</td></tr>";
//Show checkpoints data in a table
echo "<tr><td colspan='2'><table border='1'>";
echo "<tr><td>Checkpoint</td><td>Fecha</td><td>Código</td><td>Descripción</td><td>Ciudad</td><td>Estado</td><td>País</td><td>Comentarios</td></tr>";
foreach($respuesta->checkpoints as $checkpoint){
echo "<tr><td>".$checkpoint->description."</td><td>".$checkpoint->date."</td><td>".$checkpoint->code."</td><td>".$checkpoint->description."</td><td>".$checkpoint->city."</td><td>".$checkpoint->state."</td><td>".$checkpoint->country."</td><td>".$checkpoint->comments."</td></tr>";
}
echo "</table></td></tr>";
echo "</table>";
Based on the shared code snippet, you were iterating through subevent. However, I can't find any key called subevent in the response shared.
if subevent exist and it's in form of a list, then a foreach statement should work.
Kindly confirm where the subevent is coming from.
foreach ($respuesta->subevents as $subevent)

How to generate files with a custom module and PHP?

I have a site with Drupal 8. I have created a custom module. Here is its code :
https://github.com/S1BIOSE/generator_website
generator-website-page.html.twig :
<div class="card mb-5 overflow-hidden shadow rounded bg-white">
<div class="card-body">
<form>
<legend>Générateur de site web</legend>
<div class="mb-3">
<label for="TokenUrl" class="form-label">L'URL de votre site web</label>
<input type="text" class="form-control is-invalid" id="TokenUrl" required>
<div class="invalid-feedback">
Ce champ est requis.
</div>
<small id="helpUrl" class="form-text">Entrez l'URL complète de votre site web.</small>
</div>
<div class="mb-3">
<label for="TokenTitle" class="form-label">Nom de l'entreprise</label>
<input type="text" class="form-control is-invalid" id="TokenTitle" required>
<div class="invalid-feedback">
Ce champ est requis.
</div>
<small id="helpTitle" class="form-text">Entrez le nom de votre entreprise.</small>
</div>
<div class="mb-3">
<label for="TokenDescription" class="form-label">Présentation de l'entreprise</label>
<textarea class="form-control is-invalid" id="TokenDescription" rows="5" required></textarea>
<div class="invalid-feedback">
Ce champ est requis.
</div>
<small id="helpDescription" class="form-text">Entrez une description de votre entreprise.</small>
</div>
<div class="mb-3">
<label for="TokenFeed" class="form-label">Fil d'actualité</label>
<input type="text" class="form-control" id="TokenFeed">
<small id="helpFeed" class="form-text">Entrez l'url de votre Flux RSS sur la plateforme S1BIOSE.</small>
</div>
<button type="submit" class="btn btn-primary">Générer</button>
</form>
</div>
</div>
What should I put in my module to generate the 3 files above and replace the words starting with Token ?
In this custom module, I created a form with IDs (I'm not sure if this is the right way to go). For example, the data entered in the TokenTitle field must replace TokenTitle wherever it appears in the files.
When a user submits the form, it must download the 3 files with the correct data (the one entered in the form). If possible in a ZIP archive.
It is unnecessary to keep the information submitted in the form in the database.
manifest.json
{
"orientation":"portrait",
"short_name": "TokenTitle",
"name": "TokenTitle",
"display": "standalone",
"background_color": "#000000",
"theme_color": "#000000",
"description": "TokenDescription",
"lang": "fr",
"icons": [{
"src": "icon-144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "any maskable"
}, {
"src": "icon-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
}, {
"src": "icon-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}],
"start_url": "/?source=pwa",
"scope": "/"
}
sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>TokenUrl/index.html</loc>
<lastmod>TokenDate</lastmod>
</url>
</urlset>
sw.js
const staticCacheName = 'TokenTimestamp';
const filesToCache = [
'/',
'/index.html',
'/CHANGELOG.md',
'/bootstrap.min.css',
'/style.css',
'/bootstrap.bundle.min.js',
'/popover.js',
'/clipboard.min.js',
'/btn-clipboard.js',
'/pwa.js',
'/feed.js',
'/toasts.js',
'/icon-32.png',
'/icon-144.png',
'/icon-192.png',
'/icon-512.png',
'/iphone5_splash.png',
'/iphone6_splash.png',
'/iphoneplus_splash.png',
'/iphonex_splash.png',
'/iphonexr_splash.png',
'/iphonexsmax_splash.png',
'/ipad_splash.png',
'/ipadpro1_splash.png',
'/ipadpro3_splash.png',
'/ipadpro2_splash.png'
];
self.addEventListener('install', event => {
event.waitUntil(
caches.open(staticCacheName).then(cache => {
return cache.addAll(filesToCache);
})
);
});
self.addEventListener('activate', event => {
event.waitUntil(caches.keys().then(function(cacheNames) {
return Promise.all(
cacheNames.filter(function(staticCacheName) {
}).map(function(staticCacheName) {
return caches.delete(staticCacheName);
})
);
}));
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request).then(cachedResponse => {
if (cachedResponse) {
return cachedResponse;
}
return fetch(event.request);
})
);
});
self.addEventListener('message', event => {
if (event.data.action === 'skipWaiting') {
self.skipWaiting();
}
});
Don't use standard PHP to make the file, as then you'll need to handle housekeeping/ removing it/ managing it as well. Drupal has BinaryFileResponse for sending files to users and \Drupal\Core\File\FileSystemInterface for creation/ management of files. If it is temporary, then simply set it as this.
Hello ok there are the things you will need to know how todo do:
Learn how to make files with php: https://www.w3schools.com/php/php_file_create.asp
learn how Drupal routing and controllers work:
https://www.drupal.org/docs/drupal-apis/routing-system/introductory-drupal-8-routes-and-controllers-example
learn how Drupal handles forms https://www.drupal.org/docs/drupal-apis/form-api/introduction-to-form-api
once you know these things then you can use on form submit
some php to generate your files and then probably group them for download ...or what ever your doing with them.

Symfony 4.4 PHPUnit Panther : Facebook\WebDriver\Exception\SessionNotCreatedException: session not created

Here is my test file:
<?php
// src/tests/UserActionsTest.php
namespace App\Tests;
use Symfony\Component\Panther\PantherTestCase;
class UserActionsTest extends PantherTestCase {
/**
* An user can subscribe on the Blog
*/
public function testRegistration(): void {
$client = static::createPantherClient();
$crawler = $client->request('GET', '/subscribe');
// This form is generated in JavaScript
$client->waitFor('#subscribe-form');
// Form submission
$client->submitForm('Create the account', [
'username' => 'zozor',
'password' => 'ZoZ0rIsHome',
]);
// User rediction newly subscribed to the homepage
$this->assertSame(self::$baseUrl . '/', $client->getCurrentURL());
// Success notification in JavaScript
$client->waitFor('#success-message');
$this->assertSame('Welcome on the Zozor blog', $crawler->filter('#success-message ol li:first-child')->text());
// The user is well authenticatd
$this->assertSame('Zozor', $crawler->filter('#user-profile span:first-child')->text());
}
}
When I run the command:
PANTHER_NO_HEADLESS=1 ./vendor/bin/simple-phpunit --filter="UserActionsTest"
This gives me an error:
1) App\Tests\UserActionsTest::testRegistration
Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 85
./vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:125
./vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php:371
./vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:136
./vendor/symfony/panther/src/ProcessManager/ChromeManager.php:67
./vendor/symfony/panther/src/Client.php:98
./vendor/symfony/panther/src/Client.php:365
./vendor/symfony/panther/src/Client.php:254
./tests/UserActionsTest.php:13
I searched on DuckDuckGo but nothing is related to Symfony, PHPUnit, or even PHP language.
I am leaning for a version problem, here is my composer.json:
{
// ...
"require": {
"php": ">=7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "1.11.99.1",
"doctrine/annotations": "^1.11",
"doctrine/doctrine-bundle": "^2.2",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.7",
"sensio/framework-extra-bundle": "^5.6",
"symfony/apache-pack": "^1.0",
"symfony/asset": "4.4.*",
"symfony/console": "4.4.*",
"symfony/dotenv": "4.4.*",
"symfony/flex": "^1.3.1",
"symfony/form": "4.4.*",
"symfony/framework-bundle": "4.4.*",
"symfony/panther": "^0.8.0",
"symfony/security-bundle": "4.4.*",
"symfony/validator": "4.4.*",
"symfony/yaml": "4.4.*"
},
"require-dev": {
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.58",
"phpstan/phpstan-beberlei-assert": "^0.12.3",
"symfony/browser-kit": "4.4.*",
"symfony/css-selector": "4.4.*",
"symfony/maker-bundle": "^1.24",
"symfony/phpunit-bridge": "^5.2",
"symfony/stopwatch": "^4.4",
"symfony/twig-bundle": "^4.4",
"symfony/web-profiler-bundle": "^4.4"
},
// ...
}
And here is my phpunit.xml.dist:
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="bin/.phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
<env name="KERNEL_CLASS" value="App\Kernel" />
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="7.5" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="" />
<!-- ###+ doctrine/doctrine-bundle ### -->
<env name="DATABASE_URL" value="mysql://:#localhost:33060/" />
<!-- ###- doctrine/doctrine-bundle ### -->
<!-- ###+ symfony/swiftmailer-bundle ### -->
<env name="MAILER_URL" value="null://localhost" />
<!-- ###- symfony/swiftmailer-bundle ### -->
<!-- ###+ symfony/framework-bundle ### -->
<env name="APP_DEBUG" value="1" />
<env name="APP_SECRET" value="" />
<!-- ###- symfony/framework-bundle ### -->
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
<extensions>
<!-- It begins a database transaction before every testcase and rolls it back after
the test finished, so tests can manipulate the database without affecting other tests
<extension class="\DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" /> -->
<extension class="Symfony\Component\Panther\ServerExtension" />
</extensions>
</phpunit>
If I add the line as recommended by symfony/panther:
<listener class="Symfony\Component\Panther\ServerListener" />
This gives me the error:
1x: The "Symfony\Component\Panther\ServerListener" class is deprecated since Panther 0.6, use "Symfony\Component\Panther\ServerExtension" instead.
But using Symfony\Component\Panther\ServerExtension it gives me the error:
Class "Symfony\Component\Panther\ServerExtension" does not implement the PHPUnit\Framework\TestListener interface
Thank you in advance for your help.
Modification: the problem was fixed by uninstalling Chromium and installing it from the Snap Store (Linux Mint 20 / Ubuntu LTS 20.04.1):
sudo rm /etc/apt/preferences.d/nosnap.pref
sudo apt update
sudo apt full-upgrade
sudo apt install snapd
sudo snap install chromium

POST call's are randomly called as GET (Symofny 2.8)

Error! Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: "No route found for "GET /admin/.../details/save": Method Not Allowed (Allow: POST)" at /.../vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 180
This error is simple, a url has been triggered not via POST. The problem I have is that, this route is never called with GET.
<form method="POST" action="{{ path('...', {'id': id}) }}">
{{ form_widget(form._token) }}
{{ form_widget(form.id) }}
<div class="form-group">
<label class="col-lg-2 control-label">Password</label>
<div class="input-group col-lg-10">
{{form_widget(form.password, {'attr':{'class': 'form-control'} })}}
{{ form_widget(form.random) }} Random
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label"></label>
{{ form_widget(form.notify) }} Notify user?
</div>
<div class="form-group">
<label class="col-lg-2 control-label"></label>
<div class="input-group col-lg-10">
<button type="submit" class="btn btn-primary btn-lg" style="width: 33%;">Save</button>
</div>
</div>
</form>
The problem continues overall in the project. Ajax call's to search are triggered with GET and I can't figure out where the error comes from. No js errors connected to this issue (checked with sentry). Any idea?
More info from emails:
Message:
Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: "No route found for "GET /api-v2/search": Method Not Allowed (Allow: POST)" at /.../vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 180
Time:
2017-06-08 17:54:31
Channel:
request
Context:
exception:
{
"class": "Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException",
"message": "No route found for \"GET /api-v2/search\": Method Not Allowed (Allow: POST)",
"code": 0,
"file": "/.../vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:180",
"trace": [
"{\"function\":\"onKernelRequest\",\"class\":\"Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\RouterListener\",\"type\":\"->\",\"args\":[\"[object] (Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent: {})\",\"kernel.request\",\"[object] (Symfony\\\\Component\\\\EventDispatcher\\\\ContainerAwareEventDispatcher: {})\"]}",
"/.../vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:184",
"/.../vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:46",
]
}
}
Extra:
request_ip:
46.235.158.196
client_ip:
46.235.158.196
session:
[]
get:
[]
post:
[]
server:
{
"content-type": [
""
],
"content-length": [
""
],
"accept": [
"*/*"
],
"accept-language": [
"en, *;q=0.7"
],
"user-agent": [
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko"
],
"host": [
"test.com"
],
"connection": [
"Keep-Alive"
],
"x-php-ob-level": [
1
]
}
attr:
[]
cookies:
[]
files:
[]

Categories