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 is a modern, well-typed standard library for PHP 8.4+, inspired by HHVM’s HSL. It offers safer, predictable APIs for async, collections, networking, I/O, crypto, terminal UI, and robust data validation—replacing brittle built-ins with consistent alternatives.

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4