Laravel'de `.env` dosyası, uygulamanızın yapılandırma ayarlarını depolamak için kullanılan bir yapılandırma dosyasıdır. Bu dosyada, veritabanı bağlantı bilgileri, uygulama anahtarları, posta ayarları gibi önemli ayarları tanımlayabilirsiniz. İşte bir `.env` dosyası örneği:
```
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mydatabase
DB_USERNAME=root
DB_PASSWORD=
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=xxxxxxxxxxxxxxxx
MAIL_PASSWORD=xxxxxxxxxxxxxxxx
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@example.com
MAIL_FROM_NAME="${APP_NAME}"
```
Yukarıdaki örnekte, Laravel uygulamanızın adı "Laravel" olarak tanımlanmıştır. Veritabanı bağlantısı için MySQL kullanılıyor ve gerekli bilgiler ilgili değişkenlerde belirtilmiştir. Mail ayarları da tanımlanmıştır, burada Mailtrap hizmetini kullanıyoruz.
Bu örnek, temel yapılandırma ayarlarını içermektedir. Siz uygulamanıza özgü ihtiyaçlarınıza göre `.env` dosyasını düzenleyebilirsiniz. `.env` dosyasındaki ayarları güncelledikten sonra, değişikliklerin etkili olması için uygulamayı yeniden başlatmanız gerekebilir.
Unutmayın, `.env` dosyası gizli bilgiler içerebilir, bu nedenle paylaşırken dikkatli olmalısınız ve gizli bilgilerin güvenliğini sağlamak için `.env` dosyasını korumalısınız.