Category : json

If I enter the wrong url address for example http://127.0.0.1:8000/okec Undefined index: poster_path and not 404 not found <div class="col-sm-2 text-center"> <div class="figure"> @if ($infoFilm[‘poster_path’]) <img class="img-fluid img-thumbnail rounded" src="{{ ‘https://image.tmdb.org/t/p/w185/’.$infoFilm[‘poster_path’] }}" alt="Poster"> @else <img class="img-fluid img-thumbnail rounded" src="https://via.placeholder.com/200×240?text=mUaacH" alt="NoImage"> @endif </div> </div> Controller public function details($id) { $infoFilm = Http::withToken(config(‘services.tmdb.token’)) -> get(config(‘services.tmdb.apiurl’).’movie/’.$id) -> json(); ..

Read more

part of this data in store method decoded and i want to use this encoded data in blade template: How is this possible? public function store(VehiclesRequest $request) { $data = Vehicle::create([ ‘container_type’ => $request->container_type, ‘type’ => $request->type, ‘delivery_capacity’ => $request->delivery_capacity, ‘plate_number’ => json_encode($request->plate_number), ‘chasis_number’ => $request->chasis_number, ‘capacity_dimensions’ => json_encode($request->capacity_dimensions), ‘fuel_consumption_rate’ => $request->fuel_consumption_rate, ‘capacity_weight’ => $request->capacity_weight, ..

Read more

I Laravel 8.x app where the API endpoints have broken for some reason and are now returning the wrong response type. They were working fine previously and nothing has changed in the source code. The API request: axios.get(`/${this.model}/emptyTopics`, { params: params }) .then(r => { if(r.status == 200 || r.collection.length) { this.emptyTopics = r.data.collection; this.emptyTopicsDataTable.loadingVal ..

Read more

I am using vuex to store state, and I’m seeing an odd problem: it seems that it is changing the id on one of my objects. In my action, I download information about a note saveNote({commit}, noteInfo) { var formData = new FormData(); Object.keys(noteInfo.note).forEach(key => formData.append(key, noteInfo.note[key])); return axios.post("/notes/saveText/" + noteInfo.note.id, formData).then(res => commit(‘SAVE_NOTE’, res.data)).catch(err ..

Read more

I am trying to get the ID of the item stored in this Laravel queue message. I am using Python and the library phpserialize. This is the string: ‘O:26:"AppJobsGetMatchReportJob":12:{s:10:"x00*x00patient";O:45:"IlluminateContractsDatabaseModelIdentifier":4:{s:5:"class";s:11:"AppPatient";s:2:"id";i:3;s:9:"relations";a:0:{}s:10:"connection";s:5:"pgsql";}s:5:"tries";i:3;s:10:"retryAfter";i:30;s:7:"timeout";i:25;s:10:"connection";N;s:5:"queue";s:14:"optimas-result";s:15:"chainConnection";N;s:10:"chainQueue";N;s:5:"delay";N;s:10:"middleware";a:0:{}s:7:"chained";a:0:{}s:6:"x00*x00job";N;}’ As you can see, I have an object within an object. I’m trying to create an object hook, like this: class Patient(object): def __init__(self, data): self.data ..

Read more

My json response have be return garbage of data before expected result here is my controller function : public function getState() { // return $states = $this->site->getState(); // var_dump($states); $states = array( ‘name’ => ‘hab’ ); return response()->json(["data" => $states]); } and the response: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"data":{"name":"hab"}} Note: while i var_dump i get expected data: array(1) { ..

Read more

I am receiving the data from a form where I am trying to save the data to the database. While saving the first record is saved multiple times. return response()->json($request->all()); JSON { "product_combo_name":"asdfadsf", "product_values":"[{"product_data":{"id":1,"slug":"product-name","sku":"product-code","product_name":"Product Name","category_id":1,"subcategory_id":1,"previewImg":"http://localhost/EcommerceBackend/public//assets/images/product/thumb/Product Name.jpeg","hasVariants":false,"deleted_at":null,"created_at":"2020-09-17T07:17:42.000000Z","updated_at":"2020-09-17T10:54:24.000000Z"},"product_qty":"1","product_price":"100","product_tax":"18","hsn_code":"78877","product_line_total":"118.00"},{"product_data":{"id":1,"slug":"product-name","sku":"product-code","product_name":"Product Name","category_id":1,"subcategory_id":1,"previewImg":"http://localhost/EcommerceBackend/public//assets/images/product/thumb/Product Name.jpeg","hasVariants":false,"deleted_at":null,"created_at":"2020-09-17T07:17:42.000000Z","updated_at":"2020-09-17T10:54:24.000000Z"},"product_qty":"1","product_price":"100","product_tax":"18","hsn_code":"197797","product_line_total":"118.00"}]", "shipping_charges":"123", "total_price":"359.00", "combo_total_price":"124.18", "product_total_price":"236.00", "charge_breakup":"[{"name":"qty","qty":"1","per_unit_price":"1","tax":"18","tax_amount":"0.18","line_total_amount":"1.18"}]" } I am trying to save the product_data as individual value, but ..

Read more

I need to convert this file content I receive through json according to its mime type but even after using base64_decode() in php, I can’t retrieve the file. This is the json I receive from which I have to convert this data->document->file according to its mime type. {"data":{"document":{"file":"P***********************K","mime_type":"text/html","document_type":"invoice"}},"code":"0","request_id":"0b86d54a16007442536141829"} Sourc..

Read more

I totally noob in php, laravel, so I need help. Now for my script am creating a live ajax address search. I need to foreach all json data. Json example: "success":true, "rows_returned":10, "total_found":13, "data":[ { "postcode_full":"LT-98204", "postcode":"98204", "street":"Debesu0173 g. ", "house_number":"1", "address":"Debesu0173 g. 1", "city":"Pau0161ilu0117s k.", "municipality":"Skuodo r. sav.", "post_office":"Skuodo pau0161tas" }, { "postcode_full":"LT-98204", "postcode":"98204", ..

Read more

I am trying to list the response in blade. But I am unable to loop through the product_lists and charge_breakup, also the response is displayed different when called in blade. Here is the dd response #original: array:11 [▼ "id" => 3 "slug" => "" "productComboName" => "Combo 1" "products_list" => "[{"product_data":{"id":1,"slug":"product-name","sku":"product-code","product_name":"Product Name","category_id":1,"subcategory_id":1,"previewImg":"http://localh ▶" "shipping_charges" => ..

Read more

In my Laravel application, I am passing a JSON object to a Vue component: <search v-bind:library="'{{ json_encode(language_library()) }}’"></search> language_library(), for testing purposes, returns just one line: {"you_dont_have_subscription":"You don’t have an active subscription right now."} As you see, the single quote in the string is escaped. However, Vue throws this error: [Vue warn]: Error compiling template: ..

Read more

Continue my questions on Question-01 Now I want to get movie info by title but get an error ErrorException Trying to access array offset on value of type bool Controller public function movie($title) { $infoFilm = Http::withToken(config(‘services.tmdb.token’)) -> get(‘http://api.themoviedb.org/3/movie/’.$title) -> json(); dump($infoFilm); return view(‘pages.movie’, [ ‘infoFilm’ => $infoFilm ]); } Dump array:3 [▼ "success" => ..

Read more

Continue my questions on Question-01 Now I want to get movie info by ID but get an error ErrorException Trying to access array offset on value of type bool Controller public function movie($id) { $infoFilm = Http::withToken(config(‘services.tmdb.token’)) -> get(‘http://api.themoviedb.org/3/movie/’.$id) -> json(); dump($infoFilm); return view(‘pages.movie’, [ ‘infoFilm’ => $infoFilm ]); } Dump array:3 [▼ "success" => ..

Read more

I want to decrypt the email attribute of my model: protected $fillable = [ ’email’, ‘password’, ‘remember_token’, ‘status’, ‘name’, ‘lastname’, ‘password_changed_at’, ‘role’, ‘attempts’ ]; By using this mutator with JSON Append protected $appends = [’email’]; public function getEmailAttribute($value) { return $this->attributes[’email’] === Crypt::decrypt($value); } The problem I’m facing it’s that when I execute a dump ..

Read more

I want to decrypt the email attribute of my model: protected $fillable = [ ’email’, ‘password’, ‘remember_token’, ‘status’, ‘name’, ‘lastname’, ‘password_changed_at’, ‘role’, ‘attempts’ ]; By using this mutator with JSON Append protected $appends = [’email’]; public function getEmailAttribute($value) { return $this->attributes[’email’] === Crypt::decrypt($value); } The problem I’m facing it’s that when I execute a dump ..

Read more

In my controller, I get post param by this code: $params = $request->all(); And when I call to this POST route in Postman, I pass a JSON array to request: [ { "product_id":"11E86F4A-49EA-4146-B61C-0A1468096C0D", "quantity":"24" }, { "product_id":"11E86F4A-49EA-4146-B61C-0A1468096C0D", "quantity":"24" }, { "product_id":"11E86F4A-49EA-4146-B61C-0A1468096C0D", "quantity":"24" } ] But when I dd($params), my input have a "q" character in ..

Read more

I’m trying to get a title from tmdb but ErrorException Trying to access array offset on value of type int Controller $getPopuler = Http::withToken(config(‘services.tmdb.token’)) -> get(‘http://api.themoviedb.org/3/movie/popular’) -> json(); dump($getPopuler); return view(‘pages.index’, [ ‘getPopuler’ => $getPopuler ]); Blade @foreach ($getPopuler as $populer) <div class="card text-center"> <div class="container"> <img class="img-fluid img-thumbnail" src="{{ asset(‘assets/image/poster01.jpg’) }}" alt="Poster-01"> </div> <div ..

Read more

I’m trying to get a movie title from TMDb API but: ErrorException Trying to access array offset on value of type int Controller $getPopuler = Http::withToken(config(‘services.tmdb.token’)) -> get(‘http://api.themoviedb.org/3/movie/popular’) -> json(); dump($getPopuler); return view(‘pages.index’, [ ‘getPopuler’ => $getPopuler ]); The result of dump($getPopuler) gives this. Blade @foreach ($getPopuler as $populer) <div class="card text-center"> <div class="container"> <img ..

Read more