Download the PHP package mateffy/laravel-introspect without Composer

On this page you can find all versions of the php package mateffy/laravel-introspect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-introspect

Development Tests Status Latest Version GitHub Release Date

Introspect for Laravel

A utility package to analyze Laravel codebases, querying views, models, routes, classes and more directly from your codebase using a type-safe fluent API.



Query Available Filters
Views name, path, used by view, uses view, extends
Routes name, URI, controller + fn, methods, middleware
Classes name / namespace, extends parent, implements interfaces, uses traits
โคท Models ... relationships, properties, casts, fillable, hidden, read/writeable
โคท Commands ... signature, description (coming soon)

Name and a few other queries even support wildcard queries (e.g. components.*.paragraph)


Who is this for?

Are you working on a complex refactoring job and need to find all the places where a specific view is used? Are you building devtools or other things which need information about the codebase? Do you need structured schema information of your Eloquent data model?

These are all use cases where you need to introspect your codebase and find out where things are used, how they are used and what they are. This package does exactly that.


Installation

Install the package via composer:

[!NOTE]
Depending on your use case, it might make sense to install the package as a dev dependency by adding the --dev flag to the command.


Usage


Views

You can query all of the views you have in your codebase, including those that are provided by other packages and are namespaced with a prefix::. View queries return a Collection<string> of view names.

All queries support wildcards, e.g. components.*.button or *.button

Query views by view path

Query all views that are used by specific views

Query all views that use a specific view

Query all views that extend a specific view


Routes

Query through all the routes registered in your application (think like artisan route:list output), including those registered by packages. The routes are returned as a Collection<\Illuminate\Routing\Route>.

Query all routes that use a controller

Query all routes that use a specific middleware

Query routes by name

"Name equals/contains" queries support wildcards, e.g. api.products.* or *.products.*

Query routes by path

"Path equals/contains" queries support wildcards, e.g. api/products/* or */products/*


Generic Classes

Query by namespace

Query by parent

Query by interface

Query by trait


Models

Query Eloquent models based on their properties, attributes (fillable, hidden, appended, readable, writable), and relationship existence. Model queries return a Collection of model class strings (e.g., App\Models\User::class).

Query by Property Existence

Filter models based on whether they possess specific properties.

Query by Fillable Properties

Filter models based on their $fillable attributes.

Query by Hidden Properties

Filter models based on their $hidden attributes.

Query by Appended Properties

Filter models based on their $appends attributes (accessors).

Query by Readable Properties

Filter models based on "readable" properties (public getters, public properties, or attributes).

Query by Writable Properties

Filter models based on "writable" properties (public setters or public properties).

Query by Relationship Existence

Filter models based on the existence of specific relationship methods. Note: This currently checks for method presence, not relationship type or related model details.


Chaining queries with OR and AND

By default, any queries are combined with AND logic. However, you can craft more complex queries by chaining together queries with OR logic, too. This works for all queries, including models, routes, views and classes.

Some methods support multiple parameters, e.g. whereUsesMiddlewares([...]) or whereUsesProperties([...]). These methods have an all parameter that defaults to true. If set to false, the values are checked with OR logic too, matching on any of the values.


Limit the results and paginate just like using Eloquent queries

Actual Laravel pagination (->paginate(...)) is not yet supported, but you can use limit and offset to get the results you want.


DTO Examples

Get all model properties

Get Model as JSON schema


License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-introspect with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^10.0||^11.0||^12.0
laravel/prompts Version ^0.3.5
phpdocumentor/reflection-docblock Version ^5.6
roave/better-reflection Version ^6.57
spatie/invade Version ^2.1
spatie/laravel-package-tools Version ^1.16
spatie/php-structure-discoverer Version ^2.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mateffy/laravel-introspect contains the following files

Loading the files please wait ....