Skip to content

Commit

Permalink
Merge pull request #239 from francoism90/main
Browse files Browse the repository at this point in the history
Add some attributes
  • Loading branch information
freekmurze authored Jul 16, 2024
2 parents 7802065 + 589b2cd commit 94f5900
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Elements/A.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@ public function href($href)
{
return $this->attribute('href', $href);
}

/**
* @param string|null $route
* @param mixed $params
*
* @return static
*/
public function route($route, ...$params)
{
return $this->href(route($route, ...$params));
}
}
30 changes: 30 additions & 0 deletions src/Elements/Img.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,34 @@ public function src($src)
{
return $this->attribute('src', $src);
}

/**
* @param string|null $srcset
*
* @return static
*/
public function srcset($srcset)
{
return $this->attribute('srcset', $srcset);
}

/**
* @param string|null $loading
*
* @return static
*/
public function loading($loading)
{
return $this->attribute('loading', $loading);
}

/**
* @param string|null $crossorigin
*
* @return static
*/
public function crossorigin($crossorigin)
{
return $this->attribute('crossorigin', $crossorigin);
}
}

0 comments on commit 94f5900

Please sign in to comment.