Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Psl Laravel Package

azjezz/psl

PSL (PHP Standard Library) offers a consistent, well-typed set of safer, async-ready APIs to replace PHP primitives. Covers async, collections, networking, I/O, cryptography, terminal UI, and type-safe data validation with predictable errors.

View on GitHub
Deep Wiki
Context7

Graph

The Graph component provides immutable graph data structures and algorithms for working with directed and undirected graphs.

Graphs are fundamental data structures for modeling relationships and networks. This component supports directed and undirected graphs, weighted and unweighted edges, traversal (BFS, DFS), shortest path finding, topological sorting, and cycle detection. All operations are immutable and return new graph instances.

Design

The Graph component uses an adjacency list representation:

  • DirectedGraph<TNode, TWeight>: Directed graph with edges from node A to node B
  • UndirectedGraph<TNode, TWeight>: Undirected graph with bidirectional edges
  • Edge<TNode, TWeight>: Represents an edge with optional weight
  • Flexible node types: Nodes can be any type (objects, arrays, scalars, resources, etc.)

Usage

Building Graphs

@example('collections/graph-building.php')

Traversal

@example('collections/graph-traversal.php')

Shortest Path

For unweighted graphs, BFS is used. For weighted graphs, Dijkstra's algorithm is used.

@example('collections/graph-shortest-path.php')

Cycle Detection and Topological Sort

@example('collections/graph-cycle-detection.php')

Object Nodes

Nodes can be any type, including objects:

@example('collections/graph-object-nodes.php')

Use Cases

  • Dependency Resolution: Topological sort for build systems, package managers
  • Route Finding: Shortest path for navigation, network routing
  • Social Networks: Friend relationships, recommendations
  • State Machines: Transitions between states
  • Data Flow: Pipeline dependencies, task scheduling

See src/Psl/Graph/ for the full API.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle