You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, my validation not working, i install laravel-data into clean laravel 10x,
i have example laravel-data class :
`
namespace App\Data;
use Spatie\LaravelData\Data;
class MyData extends Data
{
public string $data;
public string $content;
}
`
and simple api route : Route::post('/test',function (\App\Data\MyData $data){ dd($data); });
if i send filled json to route it's normal works and return my dd data { "data":"123", "content": "123" }
but if i try to validate and send this json : { "content": "123" }
me just redirected into web route to /
my question is what am i doing wrong?
i watched a few videos, and they have everything the same as mine, but it works fine, I even tried to repeat the letter for the letter, but I get everything the same
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, my validation not working, i install laravel-data into clean laravel 10x,
i have example laravel-data class :
`
namespace App\Data;
use Spatie\LaravelData\Data;
class MyData extends Data
{
public string $data;
public string $content;
}
`
and simple api route :
Route::post('/test',function (\App\Data\MyData $data){ dd($data); });
if i send filled json to route it's normal works and return my dd data
{ "data":"123", "content": "123" }
but if i try to validate and send this json :
{ "content": "123" }
me just redirected into web route to /
my question is what am i doing wrong?
i watched a few videos, and they have everything the same as mine, but it works fine, I even tried to repeat the letter for the letter, but I get everything the same
Beta Was this translation helpful? Give feedback.
All reactions