Laravel Tutorials
- What is laravel
- Laravel Installation
- Directory Structure
- htaccess
- Remove public from url
- Artisan Command
- Laravel Configuration
- Routing Configuration
- Namespaces
- Request
- Response
- Controller
- Model
- User Authentication
- Multi User Authentication
- Database Seeding
- Database
- Database Query
- ORM
- One-to-One Relationship
- One-to-Many Relationship
- Many to Many Eloquent Relationship
- Has One Through
- Has Many Through
- Querying Relations
- Middleware
- Laravel Views
- Blade Views
- Print data on view page
- Get Site URL
- Get URL Segment
- Get images from Storage folder
- Clear cache
- Form Class not found
- Flash Message in laravel
- Redirections
- path
- CRUD Projerct
- CRUD in Laravel
- CRUD progran
- Laravel Validation
- Jquery Validation
- Cookie
- Session
- Email Send in laravel
- File uploading
- CSRF Protection
- Helper in Laravel
- Helper Functions
- Guzzle Http Client
- Paypal Payment Gatway Integration
- Cron Job in laravel
- Flash message
- path
- Errors Handling
- Date Format
- Date Format Validation
- Display Image on View Page
- Update User Status using toggle button
- Delete Multiple Records using Checkbox in Laravel?
- Confirmation Before Delete Record
- Delete image from storage
- Remove/Trim Empty & Whitespace From Input Requests
- Block IP Addresses from Accessing Website
- How to Disable New User Registration in Laravel
- Redirect HTTP To HTTPS Using Laravel Middleware
- CKEditor
- slug generate unique
- Prevent Browser's Back Button After Logout
- Datatable dunamically
- encrypt & Decript
- Download File
- Rest API
- Shopping Cart
- Shopping Cart Example
- Dynamic Category-Subcategory Menu
- Ajax Search
- Interview Question
- laravel Tutorilal link
- laravel Tutorilal
Important Links
How to get site url in laravel?
Get Site url Using URL Helper
in laravel, there are various way to get site url.
File name : index.php
Syntax:-
url('/')
Example :-
echo url('/');
or
{{ url('/') }}
Get Site url Using URL Facade
File name : index.php
Syntax:-
URL::to("/")
Example:-
$url = URL::to("/");
print_r($url);
get current URL with parameters
How to get current URL without query string in Laravel
return \URL::current();
OR
return \Request::url();
How to get current URL with query string in Laravel
return \Request::fullUrl();
How to get url parameters in Laravel
get your url segment in Laravel by using segment method
$url_segment = \Request::segment(3);
Get the current URL without the query string
File name : index.php
$currentURL = url()->current();
dd($currentURL);
Get the current URL with the query string
File name : index.php
$currentURL = url()->full();
dd($currentURL);
Get the full URL for the previous request
File name : index.php
$preURL = url()->previous();
dd($preURL);
Get the current URL Without Query String
File name : index.php
$currentURL = $request->url();
dd($currentURL);
Get the current URL With Query String
File name : index.php
$currentURL = $request->fullUrl();
dd($currentURL);
Get Only Parameters Using segment
File name : index.php
//http://www.itechxpert.in/one/two?key=value
$currentURL = $request->segment(3);
dd($currentURL);
Get current url in blade view
File name : index.php
Path: {{ Request::path() }}
Url: {{ Request::url() }}
FullUrl: {{ Request::fullUrl() }}
File name : index.php