• Home
  • Users
  • Tags
  • Write New Post
  • Website
    InfinityKnow.com
    MiniStackOverflow.com
    PakaInfo.com
  • Service
    Tricks
    Tools
    Examples
    Tutorial
  • Log in / Register
Log in / Register

laravel get env variable in controller

Posted by w3diy - 1 year ago

How to get .env variable in blade or controller in Laravel?

Syntax:

env('YOUR_VARIABLE_NAME');

Example:

env('APP_URL');

Use in Blade File:

@if (env('APP_ENV') == 'local')
   Local Enviroment
@endif

Use in Controller File:

if (env('APP_ENV') == 'local'){
    echo 'YOUR Local Enviroment';
}
Previous Trick

get last inserted id in laravel

Next Trick

laravel timezone india

We are Recommending you:

  1. Manon Martin Biography, Age, Height, Career, Net Worth, Photos & More
  2. python for loop
  3. 1377x torrent
  4. php str_replace
  5. How to Choose A Hotel for The Best Staycation Experience
  6. windows 8.0 crack
  7. Leading Names of cPanel Reseller Hosting Providers UK in 2022
  8. Sooryavanshi Movie Review: Rohit Shetty- Akshay Kumar
  9. javascript how to disable a button
  10. disable previous date in datepicker

Status

    211 views

Tags

laravel

Random Trick

windows 8.0 crack Leading Names of cPanel Reseller Hosting Providers UK in 2022 Sooryavanshi Movie Review: Rohit Shetty- Akshay Kumar javascript how to disable a button disable previous date in datepicker

Latest Trick

Top ppc Networks in USA MCA Entrance Coaching Near Me | MCA Coaching Near Me Permanent Clothing Dye - What Are the Advantages of Natural Dyeing? The Best Bird Cages For Cockatiels Benefits of Cloud UK VPS Hosting

© 2022 w3diy.com | Made with ♥ in India

➤