#### Category : response

i want to get an array with people back to my javascript popup but i gives me array(0) javascript ————————————————————————————————- function showPopup(modal_id, board_id){ var url = route(‘getCardInfo’, [modal_id, board_id]) let token = document.querySelector(‘meta[name="csrf-token"]’).getAttribute(‘content’) fetch(url, { headers: { "Content-Type": "application/json", "Accept": "application/json, text-plain, *//* only 1 line ", "X-Requested-With": "XMLHttpRequest", "X-CSRF-TOKEN": token, }, method: ‘GET’, credentials: ..

So my idea was get a Blob file from azure. Since it may be a large file I need to stream read it to backend Laravel. However, my target functionality is streaming video from azure to the client thru http response. public function stream(Video $video) {$video->watched(); //activate this $stream = Storage::readStream($video->video); $mimetype = Storage::mimeType($video->video); ..

I’m getting this error in blade. Below is the code. Controller thisSeason and thisRaces works fine. I retrieve both from a query made in my models. thisDriverStandings works also fine. The problem is with thisFullDriverStandings. public function show($seasons) { //Retrieving season data$season_data = new seasons; $thisSeason =$season_data->thisSeason($seasons); // return$thisSeason; //Retrieving race data ..

I have this function in laravel return response()->json([‘status’ => ‘error’, ‘message’ => "yes"]); Now I want to replicate it to Codeigniter and I have this return $this->response->setJSON([‘status’ => ‘error’, ‘message’ => "yes"]); But it is not working, please I need help. Sourc.. Read more Trying different solutions, I am fooling around with response()->json([ ]) To create responses that I can read in my vue / vuex application The Laravel api function that stores a new Speler ( dutch for player ;)): I have trouble sending the created, or found Speler-object, through the response to the vuex-store. Tried to set .. Read more Today I was trying to return a file as response with another array, but my front end stopped reading the blob. How can i do it? Example: return array("file"=>response()->file($file), "erros"=>$arrayDeErros); Thanks in advance Sourc.. Read more I have a Laravel controller that retrieves binary image data from some source like the database or an API and returns it as the response: class ExampleController extends Controller { // … public function testImage(Request$request) { $binaryImageData =$this->repository->getImage($request->query); return response($binaryImageData); } } However since Laravel returns a Content-Type header value of `text/html’ when ..

In my function im sending ajax request to controller than it saves data to database and im trying to get back to response each item when it saved in database. But it saved items shows empty in new array. It saves database but cant return one by one saved item in view at the same ..

In my Laravel application berkayk/onesignal-laravel package is used for notifications. And currently, it is not working and I need to log the onesignal response so I can debug the issue. Below is my function: $workspace = !empty(Config::get(‘system.one_signal_workspace’))?Config::get(‘system.one_signal_workspace’):false;$notification = null; if(!$workspace){ Log::alert([‘Workspace Not Found’]); } if(!empty($data)){ if(isset($data[‘type’]))$obj->type = $data[‘type’]; if(isset($data[‘notification_obj’])) $obj->notification =$data[‘notification_obj’]; try ..

in my web application created with Laravel 8, I need to download an .xml file and the file name must be dynamically created, as per the title. this is because the file name is composed following a specific rule and having to include today’s date. $filename = ‘FirstPart_’.date("Y-m-d").’_000.xml’ so far to test the response and .. Read more I have a simple action public function testInsuranceRequest(Request$request) { $result = rand(1,5); return$result; } but when I test it in Postman, the response time is more than 4 seconds. Futhermore, Postman shows the result immidiately, but response time continues to grow. I’ve installed Laravel Profiler and see the following Please, help – where ..

I am executing a simple form with "post", with (name, email, message), without even adding a connection or queries to the database, the request is made correctly, however this verifying that the response time from the server is around 700ms . I have also tried to make an identical form but by ajax and the ..

I am kinda new in php so I am not sure how to do this efficiently. So I have an example json response and I want to send it as json back. [ {"id": "1", "title": "name"}, {"id": "2", "title": "id", "name": "something" }, {"id": "3", "title": "Rush", "role": "model"} ] public function getMetaData() { ..

I’m facing very slow loading on every page even in production, like 5-7 seconds only rendering page and I don’t know why. I’m thinking it has something to do with external Firebird database I’m using. I downloaded laravel debugbar and came across this: CISELPOD_UZIV_WEB is my users table and as you can see the simple ..

I hosted my Laravel API project on two servers. I am getting different responses from different servers. From one server I am getting an Integer response, while other servers responding String. The expected response is Integer. I put an example below. Server 1’s response { is_active: 1 } Server 2’s response { is_active: ‘1’ } ..

I am new to the forum, I hope I have complied with all the forum guidelines in posting my answer. In my web application that I am developing with Laravel 8, I need to download .zip files To do this, looking online I decided to use the maennchen/zipstream-php package. For the creation of the zip ..

In an application I’m building, I return the user to a program list page, after they have edited an academic Program. I’m using the return redirect()->with() methods to return to the list page, however I am trying to append an in-page link to the success message, so the user can jump to the edited program’s ..

I’m making an application which serving audio files, my backend is running on laravel and I’m using service worker to cache the audio files, the issue is when those files get fetched from laravel’s storage the response looks something like this I don’t know what the issue is exactly, any help would be appreciated. Thank ..

In the laravel controller if someone wants to just send html as response and show it in the browser what is the best way to perform this action without any issue. I want something like: $html = "<html>– All html document content –</html>" // to show as html in browser. return$html; Sourc..

The following site explains how to send data from the server, but not how to retrieve data on the front-end side. How can I retrieve the data on the front-end side? https://yajrabox.com/docs/laravel-datatables/master/response-with use DataTables; Route::get(‘user-data’, function() { $model = AppUser::query(); return DataTables::eloquent($model) ->with(‘posts’, 100) ->with(‘comments’, 20) ->toJson(); }); Example Response { "draw": 1, "recordsTotal": 10, ..

public function addcart($request) {$patient_id = config(‘api.current_user.patient_id’) ? config(‘api.current_user.patient_id’) : 0; $patient = Patient::find($patient_id); $patient_diagnostic_cart = @unserialize($patient->diagnostic_cart); $response = []; if (!empty($patient_diagnostic_cart)) { if (in_array((int)$request->test_id,$patient_diagnostic_cart)) { // abort(400, "Test allready added"); $message = "Test allready added"; } else { array_push($patient_diagnostic_cart, (int)$request->test_id);$patient->diagnostic_cart = serialize($patient_diagnostic_cart);$patient->save(); $message = "Test added"; } } else {$patient_diagnostic_cart ..

public function addcart($request) {$patient_id = config(‘api.current_user.patient_id’) ? config(‘api.current_user.patient_id’) : 0; $patient = Patient::find($patient_id); $patient_diagnostic_cart = @unserialize($patient->diagnostic_cart); $response = []; if (!empty($patient_diagnostic_cart)) { if (in_array((int)$request->test_id,$patient_diagnostic_cart)) { // abort(400, "Test allready added"); $message = "Test allready added"; } else { array_push($patient_diagnostic_cart, (int)$request->test_id);$patient->diagnostic_cart = serialize($patient_diagnostic_cart);$patient->save(); $message = "Test added"; } } else {$patient_diagnostic_cart ..

This laravel code downloads the file but its contents are empty $doc = Document::find($id); $filePath = Storage::path($doc->path); $header = [‘Content-Type: application/pdf’]; return response()->download($filePath, $doc->name,$header); Sourc..
I use Laravel and through a Controller I return response()->json($response); method to get some content, if I click back, instead of it actually going back one page in the history, it instead shows the content returned by the Ajax query.$response consists of: $response = [ ‘success’ => true, ‘ajaxUrl’ => route(‘list’,$options), ‘title’ => ..