• Час читання ~1 хв
  • 08.04.2023
 
 

Привіт! Оскільки ви тут, вас може зацікавити моя книга "Advanced PHP Strings: Text analysis, generation, and parsing через. Laravel», який охоплює розбір тексту, маніпулювання рядками, керування кодуванням символів та багато іншого.

Книга містить понад 700 сторінок докладних роздумів від помічників струн Laravel до написання аналізатора корнішонів і лез.

Команду route:list можна використовувати для відображення списку всіх зареєстрованих маршрутів для програми. Ця команда відобразить домен, метод, URI, ім'я, дію та проміжне програмне забезпечення для маршрутів, які вона включає у згенеровану таблицю.

У наведеному нижче прикладі показано, як використовувати команду без будь-яких параметрів:

php artisan route:list

It will generate a table similar to the following output (the exact table entries will depend on the registered routes).

The registered routes

Таблицю маршрутів можна відфільтрувати за допомогою різних параметрів, визначених командою. У таблиці нижче перелічено та описано всі параметри, які підтримує команда. Деякі з опцій підтримують надані користувачем фільтри, які позначаються з'являється <TERM> в назві параметрів. Замініть <TERM> значенням, за яким потрібно фільтрувати, під час виконання команди.

Option Name Description Default Value
--method=<TERM> Filters the routes by method. None
--name=<TERM> Filters the routes by name. None
--path=<TERM> Filters the routes by path (URI). None
--reverse Reverses the order the routes are displayed in the table. None
-r Reverses the order the routes are displayed in the table (shortcut to --reverse). None
--sort The column to sort by. Accepted values are host, method, uri, name, action or middleware. uri

Наступні приклади демонструють ефекти різних варіантів.

Фільтрування маршрутів за назвою:Цей самий процес можна повторити для --method параметрів and--path:Наступні приклади демонструють, як викликати команду з різними іншими параметрами:

# Filter the route list by name.
php artisan route:list --name=account

After the above command has executed, a table will be generated that only contains routes that have account in the name column:

Filtered routes

# Filter the route list by URI.
php artisan route:list --path=account
 
# Filter the route list by method.
php artisan route:list --method=GET

The filters can be combined; results will be aggregated using "and" logic. The following command:

php artisan route:list --path=account --method=GET

can be interpreted as "find all routes that contain account in the URI and contain GET in the method."

# Filter the routes and display them in reverse order.
php artisan route:list --method=GET --reverse
 
# The following is equivalent to the previous example.
php artisan route:list --method=GET -r
 
# Filter the routes and sort `name` column.
php artisan route:list --method=GET --sort=name

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

Про мене

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

Про автора CrazyBoy49z
WORK EXPERIENCE
Контакти
Ukraine, Lutsk
+380979856297