Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel base url

// Get the base URL.
echo url('');

// Get the app URL from configuration which we set in .env file.
echo config('app.url'); 
Comment

Laravel get url

Example 1: current() with Helper

$currentURL = url()->current();
  
dd($currentURL);
Example 2: full() with Helper(with query string parameters)

$currentURL = url()->full();
    
dd($currentURL);
Example 3: current() with Facade

$currentURL = URL::current();
    
dd($currentURL);
Example 4: full() with Facade(with query string parameters)

$currentURL = URL::full();
    
dd($currentURL);
Example 5: using Request

$currentURL = Request::url();
  
dd($currentURL);
Get Previous URL in Laravel:

$url = url()->previous();
  
dd($url);
Get Current Route in Laravel:


$route = Route::current()->getName();
  
dd($route);
Comment

laravel url

{{ URL::asset('css/css.css') }} 
Comment

laravel url

// before: http://yourdomain.test/routename
secure_url(route("routename", ["querystring" => "something"], false));
// after: https://yourdomain.test/routename?querystring=something
Comment

PREVIOUS NEXT
Code Example
Php :: php convert number to month 
Php :: tcpdf error unable to create output file in php 
Php :: get the page content in wordpress 
Php :: spatie media library retrieve media from url 
Php :: ci count 
Php :: access config variable in codeigniter controller 
Php :: open php ini from terminal 
Php :: turn text file to string php 
Php :: check string in php 
Php :: laravel where has 
Php :: truncate table laravel eloquent 
Php :: access storage from the view laravel 6 
Php :: php translate url wpml 
Php :: laravel excel set cell height 
Php :: php string to char array 
Php :: HTML Snippets not working in .php files 
Php :: wordpress get user by id 
Php :: Get color code from string 
Php :: explode function in laravel 
Php :: php parse html 
Php :: grouping routes in laravel 
Php :: laravel where condition on relationship 
Php :: Creating a Basic Route in Laravel 8 
Php :: oci_execute(): ORA-01810: format code appears twice in 
Php :: time zone set in codeigniter 
Php :: php generate random string 
Php :: PHP str_replace — Replace all occurrences of the search string with the replacement string 
Php :: laravel difference between current time and created time 
Php :: PHP Warning: Version warning: Imagick was compiled against Image Magick version 1654 but version 1650 is loaded. 
Php :: laravel if database has table 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =