PHPackages                             tpaksu/xdebug-toggle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tpaksu/xdebug-toggle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tpaksu/xdebug-toggle
====================

Toggles on/of the already installed xdebug extension on php.ini file.

0.2.1(5y ago)669MITPHP

Since Jun 16Pushed 5y agoCompare

[ Source](https://github.com/tpaksu/xdebug-toggle)[ Packagist](https://packagist.org/packages/tpaksu/xdebug-toggle)[ Docs](https://github.com/tpaksu/xdebug-toggle)[ RSS](/packages/tpaksu-xdebug-toggle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Laravel Valet XDebug Toggler Artisan Command
============================================

[](#laravel-valet-xdebug-toggler-artisan-command)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5496c3b9f0f865a150d33a216dc681d6775e7790b8dcb4677289ca5a8d8d327e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7470616b73752f7864656275672d746f67676c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tpaksu/xdebug-toggle)[![Build Status](https://camo.githubusercontent.com/5160546f059aaba18b550e276b4644867af01f1b10e60d24eeecd10c36146976/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7470616b73752f7864656275672d746f67676c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/tpaksu/xdebug-toggle)[![Quality Score](https://camo.githubusercontent.com/bb9cf957ab6ff1a5805352067021c4c6a6e74b999db6b68d0ce7888461b9be80/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7470616b73752f7864656275672d746f67676c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/tpaksu/xdebug-toggle)[![Total Downloads](https://camo.githubusercontent.com/abbebc7b7342ec1eac1f940cb2e5558ed83e9d745844b906238b9d035f9357a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7470616b73752f7864656275672d746f67676c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tpaksu/xdebug-toggle)[![StyleCI](https://camo.githubusercontent.com/47ab2684185e545ba853f8c663fcb455e3fbea811437c4271ef3137099ead3c9/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f373534383938362f736869656c64)](https://github.styleci.io/repos/271391496)

This package automates the XDebug extension activation/deactivation process by adding a console command to Laravel's artisan command. It does these things:

- Modifying the current INI file used by PHP, located with parsing the "php\_info()" output containing the line "Loaded Configuration File: \[path/to/php.ini\]"
- Restarting the valet NGINX server with the command `valet restart nginx`

If you use something else than Laravel Valet, and want to automate your stuff, you can change the **XDEBUG\_SERVICE\_RESTART\_COMMAND** in your environment file, or the `xdebugtoggle.service_restart_command` configuration in xdebug-toggle.php configuration file to suit your own.

Installation
------------

[](#installation)

You can install the package as a development requirement via composer:

```
composer require tpaksu/xdebug-toggle --dev
```

Usage
-----

[](#usage)

To enable XDebug in current environment:

```
php artisan xdebug on
```

To disable it:

```
php artisan xdebug off
```

### Configuration

[](#configuration)

You can export the configuration file by running the command:

```
php artisan vendor:publish --provider="Tpaksu\XdebugToggle\XdebugToggleServiceProvider"
```

which includes:

**service\_restart\_command** : Gives you the option to run a script after you change the *php.ini* line with the new XDebug status. The default is

```
valet restart nginx
```

which applies the new php.ini configuration on the PHP running on valet's nginx server.

I tried and succeded with this command on Windows running Laragon with nginx:

```
c:/laragon/bin/nginx/nginx-1.12.0/nginx.exe -p c:/laragon/bin/nginx/nginx-1.12.0 -c conf/nginx.conf -s reload
```

which I changed with setting this environment variable on `.env` and ran `php artisan config:cache` to apply the environment changes:

```
XDEBUG_SERVICE_RESTART_COMMAND="c:/laragon/bin/nginx/nginx-1.12.0/nginx.exe -p c:/laragon/bin/nginx/nginx-1.12.0 -c conf/nginx.conf -s reload"
```

I could change the configuration setting on `config/xdebug-toggle.php` file too. This would also be a valid modification on the path.

**Note: Don't forget to run `php artisan config:cache` to apply new settings when you change any `.env` parameter or configuration setting. Not only for this package, for all changes inside Laravel.**

### Testing

[](#testing)

Any tests written yet. But I suppose I should.

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details. Any contributions are welcome.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Taha PAKSU](https://github.com/tpaksu)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

2161d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/baa85957b85812994a17cbfd9b1e63272c309c551aa94c78e7393efb9f967040?d=identicon)[tpaksu](/maintainers/tpaksu)

---

Top Contributors

[![tpaksu](https://avatars.githubusercontent.com/u/3295?v=4)](https://github.com/tpaksu "tpaksu (4 commits)")

---

Tags

laravellaravel-artisan-commandxdebugxdebug-toggletpaksuxdebug-toggle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tpaksu-xdebug-toggle/health.svg)

```
[![Health](https://phpackages.com/badges/tpaksu-xdebug-toggle/health.svg)](https://phpackages.com/packages/tpaksu-xdebug-toggle)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
