Skip to content

Commit

Permalink
all previous beta nav generator approched removed, added new approch
Browse files Browse the repository at this point in the history
  • Loading branch information
Nur Alam committed Feb 26, 2023
1 parent ae2698e commit 2ae647d
Show file tree
Hide file tree
Showing 28 changed files with 446 additions and 2,018 deletions.
15 changes: 4 additions & 11 deletions config/navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
use RadiateCode\LaravelNavbar\Presenter\NavBarPresenter;

return [
/**
* Controllers path to generate navs
*/
'controllers-path' => app_path('Http/Controllers'),

/**
* Presenter for navbar style
*
Expand All @@ -18,10 +13,8 @@
/**
* Cache the render navbar
*/
'cache-enable' => true,

/**
* Cache living duration
*/
'cache-time' => now()->addDay(),
'cache' => [
'enable' => true,
'ttl' => now()->addDay() // cache duration
],
];
29 changes: 29 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
</phpunit>
13 changes: 0 additions & 13 deletions src/Attributes/AppendTo.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/Attributes/AppendableNavLinks.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Attributes/Nav.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Attributes/NavLinks.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Attributes/ParentNav.php

This file was deleted.

38 changes: 38 additions & 0 deletions src/Children.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace RadiateCode\LaravelNavbar;

class Children
{
protected array $navs = [];

protected Nav $nav;

public function __construct()
{
$this->nav = new Nav();
}

public function add(string $title, string $url, array $attributes = [], ?callable $configure = null): Children
{
$this->nav->add($title, $url, $attributes, $configure);

return $this;
}

public function addIf($condition, string $title, string $url, array $attributes = [], ?callable $configure = null): Children
{
$condition = is_callable($condition) ? $condition() : $condition;

if ($condition) {
$this->add($title, $url, $attributes, $configure);
}

return $this;
}

public function render()
{
return $this->nav->render();
}
}
38 changes: 0 additions & 38 deletions src/Console/NavCacheClearCommand.php

This file was deleted.

28 changes: 0 additions & 28 deletions src/Contracts/NavPrepare.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Contracts/PermissionsResolver.php

This file was deleted.

12 changes: 1 addition & 11 deletions src/Contracts/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,5 @@

interface Presenter
{
public function openNavTag(string $class = null, array $attributes = []): string;

public function closeNavTag(): string;

public function openNavULTag(string $class = null, array $attributes = []): string;

public function closeNavULTag(): string;

public function header(string $title, string $class = null, array $attributes = []): string;

public function nav($menu): string;
public function navbar(): string;
}
11 changes: 0 additions & 11 deletions src/Contracts/WithNavbar.php

This file was deleted.

9 changes: 0 additions & 9 deletions src/Enums/Constant.php

This file was deleted.

73 changes: 0 additions & 73 deletions src/FilesFinderService.php

This file was deleted.

Loading

0 comments on commit 2ae647d

Please sign in to comment.