How to hide URL in a link button in laravel

Active3 hr before
Viewed126 times

7 Answers


Thanks for contributing an answer to Stack Overflow!, Meta Stack Overflow , Stack Overflow Public questions & answers , Stack Overflow help chat

change your route type from GET to POST

Route::post('/addApprovalRequestor', 'controllerName@methodName');

Use form with post request then url will be hidden

<form action="{{url('/addApprovalRequestor')}}" method="post">
     //save values in hidden input and this form will send it to server
     <input type="hidden" name="approval_requester_id" value="{{$approval_requester_id}}">
     <input type="hidden" name="user_id" value="{{$user->id}}">
   <button type="submit">submit</button>


function methodName(Request $request) {
   dd($request - > request);
   //do what you want here
load more v

action asset route secure_asset secure_url url,The csrf_field function generates an HTML hidden input field containing the value of the CSRF token. For example, using Blade syntax:,The method_field function generates an HTML hidden input field containing the spoofed value of the form's HTTP verb. For example, using Blade syntax:,The csrf_token function retrieves the value of the current CSRF token:

The Arr::accessible method determines if the given value is array accessible:

use Illuminate\ Support\ Arr;
use Illuminate\ Support\ Collection;

$isAccessible = Arr::accessible(['a' => 1, 'b' => 2]);

// true

$isAccessible = Arr::accessible(new Collection);

// true

$isAccessible = Arr::accessible('abc');

// false

$isAccessible = Arr::accessible(new stdClass);

// false
load more v

When a Yii application starts processing a requested URL, the first step it takes is to parse the URL into a route. The route is then used to instantiate the corresponding controller action to handle the request. This whole process is called routing.,When developing a complex Web application, it is important to optimize URL rules so that it takes less time to parse requests and create URLs.,Note that you should also list these modules in yii\web\Application::bootstrap() so that they can participate the bootstrapping process.,When using the default URL format, parsing a request into a route is as simple as getting the value of a GET query parameter named r.

By configuring the urlManager component in the application configuration, you can let your application recognize arbitrary URL formats without modifying your existing application code. For example, you can use the following code to create a URL for the post/view action:

use yii\ helpers\ Url;

// Url::to() calls UrlManager::createUrl() to create a URL
$url = Url::to(['post/view', 'id' => 100]);
load more v

On seriously malformed URLs, parse_url() may return false. ,Example #2 A parse_url() example with missing scheme,Example #1 A parse_url() example,parse_str() - Parses the string into variables

http: // → query = null, fragment = null
   http: // → query = "",   fragment = null
   http: // → query = null, fragment = ""
   http: // → query = "",   fragment = ""
load more v

You can retrieve the url and path to the file associated with the Media-object using getUrl, getTemporaryUrl (for S3 only) and getPath:,If you want to remove all associated media in a specific collection you can use the clearMediaCollection method. It also accepts the collection name as an optional parameter:,To retrieve files you can use the getMedia-method:,You can also retrieve the size of the file via size and human_readable_size :

To retrieve files you can use the getMedia-method:

$mediaItems = $yourModel - > getMedia();
load more v

HTML | download Attribute,HTML | <frame> src Attribute,HTML | <iframe> src Attribute,filename: attribute specifies the name for the file that will be downloaded.Example:  

To trigger a file download on a button click we will use a custom function or HTML 5 download attribute.
Approach 1: Using Download attribute 
The download attribute simply uses an anchor tag to prepare the location of the file that needs to be downloaded. The name of the file can be set using the attribute value name, if not provided then the original filename will be used.

<a download="filename">
load more v

Learn how to style outline buttons with CSS.,Your message has been sent to W3Schools.,Add the border-radius property to create rounded outline buttons:,Go to our CSS Buttons Tutorial to learn more about how to style buttons.

Add the border-radius property to create rounded outline buttons:

border - radius

Other "undefined-undefined" queries related to "How to hide URL in a link button in laravel"