Category : request

I find something lost… The problem I need to construct 2 custom FormRequest from 1 normal Request Let’s suppose this fake scenario First FormRequest StoreClientRequest Second FormRequest UpdateClientRequest On the Controller: public function store(Request $request){ //Do something… $firstRequest = new StoreClientRequest($request); $secondRequest = new UpdateClientRequest($request); } Are there way to make something similar to this ..

Read more

I created routes with type (POST), and when visit it directly, it get this error: The GET method is not supported for this route. Supported methods: POST. how to handle getting this error if anyone visit it from URL without press a form submit or something like that. the routes: Route::group([‘middleware’=>’guest:web’], function(){ Route::post(‘/post-login’, [LoginController::class,’postLogin’])->name(‘site.postLogin’); Route::post(‘/register-create’, ..

Read more

I am creating react js and laravel project and I display 3D model from database. <model-viewer bounds="tight" src={`http://localhost:8000/${item.pimage}`} ar ar-modes="webxr scene-viewer quick-look" camera-controls environment-image="neutral" poster="poster.webp" shadow-intensity="1" camera-orbit="-7.313deg 27.56deg auto" width="60px" className="model"></model-viewer> Error: GET http://localhost:3000/uploads/products/1640341595.glb 431 (Request Header Fields Too Large) GET http://localhost:3000/admin/poster.webp 431 (Request Header Fields Too Large) Ho fix this Request Header Fields Too ..

Read more

On localhost all is good, but when I deploy the application to the server not working. If form request validation fails instead of bringing me back to the same page and showing an error, it redirects me to the index page. config.blade.php <form method="POST" action="{{ route(‘config.update’, $config->id) }}"> @csrf @method(‘PUT’) <div class="form-group row"> <div class="col"> ..

Read more

I have one api which is responsible for downloading the excel sheet , my request object contains some values ,based on the request object i want to fetch the user_ID value please help me to fix this issue..? dd($request) ^ AppContainersChargeUIAPIRequestsGetAllUsersRequest {#1638 #transporter: "AppContainersChargeDataTransportersGetAlluserssTransporter" #access: array:2 [ "permissions" => "list-payments" "roles" => "" ] #decode: ..

Read more

This is a simple laravel controller <?php namespace AppHttpControllers; use AppHttpControllersController; use AppModelsUser; class UserController extends Controller { /** * Show the profile for a given user. * * @param int $id * @return IlluminateViewView */ public function show($id) { return view(‘user.profile’, [ ‘user’ => User::findOrFail($id) ]); } } when the method show() is called, ..

Read more

I have an API that uses $request->getContent(); to get the body (which is JSON) and I want to write some feature tests to test this endpoint but I can’t find a way to set the body in a Laravel feature test: public function testSuccessfullyProcessed() { $json = ‘<json>’; $response = $this->get(‘/api/process’); $response->assertStatus(200); } there isn’t ..

Read more

I created a classic Validation Request class. <?php namespace AppHttpRequests; use IlluminateFoundationHttpFormRequest; class StoreCattleTypeRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return ..

Read more

From my raspberry, I send a json to Laravel with requests.post method in python. I need to know how I can catch this json in Laravel and displaying it. Raspberry code that send json def readFile(): with open("/home/pi/Desktop/Progetti SIoTD/Bluetooth/device.txt", "r") as file: for i in file: line, *lines = i.split() if line in mac_dict: mac_dict[line] ..

Read more

Below given is the request array while submitting a form with a file and some texts. array:6 [▼ "_token" => "jcM4LprgOI9Vx9JzcFUE0rUMXxRVHGe8XgOm4CcH" "name" => "Some1" "email" => "[email protected]" "description" => "Just description." "birth_year" => "1287" "file_upload" => IlluminateHttpUploadedFile {#1214 ▼ -test: false -originalName: "Skin Infections.pdf" -mimeType: "application/pdf" -error: 0 #hashName: null path: "C:xampp_php8tmp" filename: "phpDC93.tmp" basename: ..

Read more

I have a problem, when I go to reload the Laravel page to which I am sending a JSON file I get this error however both in the route and in the request I use the post method. Can someone help me? Laravel code for the route: Route::post(‘dictionary’, [DictionaryController::class, ‘store’])->name(‘dictionary’); Laravel code for controller: class ..

Read more