Here's an example of how to set parameters:
For instance:
http://localhost/firecek_web/pengaduan?barcode=8571385
Define the route:
Route::get('/pengaduan','PengaduanController@index');
Here's an example of how to set parameters:
For instance:
http://localhost/firecek_web/pengaduan?barcode=8571385
Define the route:
Route::get('/pengaduan','PengaduanController@index');
No modifications are needed to your route definition. Keep it as is:
Route::get('/pengaduan', 'PengaduanController@index');
When making the request, simply add it to your URL as specified in your description:
http://localhost/firecek_web/pengaduan?barcode=8571385
^^^^^^^^^^^^^^^^
In your controller:
PengaduanController.php
public function index(Request $request)
{
$value = $request->query('barcode');
// Alternatively:
$value = $request->get('barcode');
// Or even simpler:
$value = $request->barcode;
dd($value); // '8571385'
}
Refer to this section of the documentation for more details:
Retrieving Input From The Query String
Use the
input
method to retrieve values from the entire request payload, including the query string. If you only need to retrieve values from the query string, use thequery
method:$name = $request->query('name');
If the requested query string value is not found, you can specify a default value as the second argument:
$name = $request->query('name', 'Helen');
Calling the
query
method without arguments retrieves all query string values as an associative array:$query = $request->query();
I recently set up Xampp on my computer, but encountered an issue when trying to access http://localhost/phpmyadmin/. An error message appeared stating: Error MySQL said: Documentation 2002 - No connection could be made because the target machine activel ...
I'm working on my portfolio website that will be available in two languages, Thai and English. I have successfully implemented language buttons for changing between the two languages. However, I am facing an issue with the language selection when nav ...
I need help with customizing my gallery that is dynamically generated from a directory using PHP. My goal is to display only 2 rows of 4 images each, totaling 8 images, with a "show more" button for loading additional rows. How can I set a limit on the n ...
I'm a beginner and I'm trying to enhance this code by adding some extra features. When the form is submitted, I want the page to redirect to an external URL like www.google.com The checkbox should be automatically checked and when the client re ...
Longtime follower of stackoverflow but only my second time posting a question. Here is the code I am currently working on: echo "<td><a href = 'http://localhost/map/index.php' value='$id' >Delete</a></td>"; ...
During my PHP class, I encountered a scenario where one of the methods required access to a database. How should I properly pass a database connection variable to this method? Should it be passed as a parameter through the constructor or directly in the ...
I am currently in the process of setting up a SOAP web service that is supposed to return a composite message. An example of a valid instance of this message looks like the following: <dl190Response xmlns="http://pse/"> <cdhead cisprik="556 ...
I'm facing an issue where my span element is being treated as a DomText object, making it difficult for me to retrieve the attribute of the span. Despite trying various solutions, I have found that using a simple DomDocument (instead of xpath) is fas ...
Is there a way to retrieve metrics information for custom metrics on a per/instance basis? I'm currently able to get the information for included metrics, but not for custom ones like CPUUtilization. I'm unsure if I'm using the correct NameS ...
I developed a specialized Wordpress plugin that enables users to incorporate custom HTML element tags (such as <my-element>) into the content of a Post. This allows users without the unfiltered_html capability to utilize predefined custom tags. The ...
Currently, I am working on developing a signup form using HTML/CSS/JS that involves utilizing an AJAX request to interact with the server. Within my jQuery code, I have implemented a method for validating the form inputs, which also triggers a function (en ...
I'm struggling with the contact form on my website. Instead of sending an email after clicking on each input field, I want it to send only one email after hitting the submit button. Currently, it sends a total of 5 emails - 1 with user inputs and 4 wi ...
Seeking help as a newcomer to the world of Laravel and Vue.js. Trying to populate data on a Vue component, but facing an issue with the tableData variable in the axios.get response. It is not rendering the array data onto the table as expected. Could there ...
I am currently in the process of integrating the WMD editor into my website. Everything seems to be functioning correctly so far, but I have hit a roadblock: How can I store the entered information in my database? I have developed a JS/Ajax function that a ...
$ref_id = mysql_insert_id(); $locatie = 'iso_photo/afwijkingen'; if($_FILES['uploaded']['type'] != 'application/octet-stream') // Geen php files { $folder = $locatie.basename($_FILES['uploaded ...
Hello everyone, I could really use some assistance right now. The issue I'm facing is that the error div is not showing the content I expect in the success function of my AJAX request. I've tried alerting the response, which returns true if the ...
I have a list of posts with a "created_at" column. I am looking to only retrieve posts that are within 10 minutes old based on their creation time. I have come across many examples of using whereBetween, but they all involve passing values through inputs ...
I attempted to utilize AJAX to send form data to a .TXT file using PHP code. The information is successfully being added to the text file, however, the AJAX functionality is not functioning properly. Can someone please point out the error in my code? ...
After creating a custom loop that displays only one post at a time, I encountered an issue with the navigation between posts using next_post_link() and previous_post_link(). The problem arises from my post hierarchy where there is a parent category common ...
I am encountering an issue with a template using AngularJS. The template displays a list of books with checkboxes for performing batch actions such as deleting the books. If the list gets too long, the books are paginated. The problem arises when I check ...