Skip to content

Commit

Permalink
Merge pull request #2 from dwarfhq/release/1.1
Browse files Browse the repository at this point in the history
overwrite namespace
  • Loading branch information
Chrvang authored Feb 17, 2023
2 parents 16b9f9c + fbf1a25 commit 2896342
Show file tree
Hide file tree
Showing 31 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dusk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: whitecube/nova-flexible-content-tests
repository: dwarfhq/nova-flexible-content-tests
event-type: dusk-tests
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See the full docs at [https://whitecube.github.io/nova-flexible-content](https:/
### Install

```
composer require whitecube/nova-flexible-content
composer require dwarfhq/nova-flexible-content
```

### Usage
Expand All @@ -35,7 +35,7 @@ Layouts can be added using the following method on your Flexible fields:
The `$name` parameter is used to store the chosen layout in the field's value. Choose it wisely, you'll probably use it to identify the layouts in your application.

```php
use Whitecube\NovaFlexibleContent\Flexible;
use Dwarfhq\NovaFlexibleContent\Flexible;

/**
* Get the fields displayed by the resource.
Expand Down Expand Up @@ -87,7 +87,7 @@ Laravel 7 brings custom casts to the table, and flexible content fields are the
namespace App;

use Illuminate\Database\Eloquent\Model;
use Whitecube\NovaFlexibleContent\Value\FlexibleCast;
use Dwarfhq\NovaFlexibleContent\Value\FlexibleCast;

class MyModel extends Model
{
Expand Down Expand Up @@ -163,7 +163,7 @@ As explained in the documentation, you can [access nova-page's static content](h
namespace App\Nova\Templates;

// ...
use Whitecube\NovaFlexibleContent\Concerns\HasFlexible;
use Dwarfhq\NovaFlexibleContent\Concerns\HasFlexible;

class Home extends Template
{
Expand Down
20 changes: 10 additions & 10 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Flexible field can be used in various ways and for different purposes, but i
### Install

```
composer require whitecube/nova-flexible-content
composer require dwarfhq/nova-flexible-content
```

### Usage
Expand All @@ -30,7 +30,7 @@ Layouts can be added using the following method on your Flexible fields:
The `$name` parameter is used to store the chosen layout in the field's value. Choose it wisely, you'll probably use it to identify the layouts in your application.

```php
use Whitecube\NovaFlexibleContent\Flexible;
use Dwarfhq\NovaFlexibleContent\Flexible;

/**
* Get the fields displayed by the resource.
Expand Down Expand Up @@ -143,7 +143,7 @@ This can be done trivially by using the `FlexibleCast` class in this package:
namespace App;

use Illuminate\Database\Eloquent\Model;
use Whitecube\NovaFlexibleContent\Value\FlexibleCast;
use Dwarfhq\NovaFlexibleContent\Value\FlexibleCast;

class MyModel extends Model
{
Expand Down Expand Up @@ -199,7 +199,7 @@ By implementing the `HasFlexible` trait on your models, you can call the `flexib
namespace App;

use Illuminate\Database\Eloquent\Model;
use Whitecube\NovaFlexibleContent\Concerns\HasFlexible;
use Dwarfhq\NovaFlexibleContent\Concerns\HasFlexible;

class MyModel extends Model
{
Expand Down Expand Up @@ -264,7 +264,7 @@ namespace App\Nova\Flexible\Layouts;

use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Markdown;
use Whitecube\NovaFlexibleContent\Layouts\Layout;
use Dwarfhq\NovaFlexibleContent\Layouts\Layout;

class SimpleWysiwygLayout extends Layout
{
Expand Down Expand Up @@ -332,8 +332,8 @@ In addition to reusable Layout classes, you can go a step further and create `Pr
namespace App\Nova\Flexible\Presets;

use App\PageBlocks;
use Whitecube\NovaFlexibleContent\Flexible;
use Whitecube\NovaFlexibleContent\Layouts\Preset;
use Dwarfhq\NovaFlexibleContent\Flexible;
use Dwarfhq\NovaFlexibleContent\Layouts\Preset;

class WysiwygPagePreset extends Preset
{
Expand Down Expand Up @@ -475,7 +475,7 @@ Quick example, consider `Post` has a flexible field with a `SliderLayout`:
use Spatie\MediaLibrary\HasMedia;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\InteractsWithMedia;
use Whitecube\NovaFlexibleContent\Concerns\HasFlexible;
use Dwarfhq\NovaFlexibleContent\Concerns\HasFlexible;

class Post extends Model implements HasMedia
{
Expand All @@ -486,9 +486,9 @@ class Post extends Model implements HasMedia

```php
use Spatie\MediaLibrary\HasMedia;
use Whitecube\NovaFlexibleContent\Layouts\Layout;
use Dwarfhq\NovaFlexibleContent\Layouts\Layout;
use Ebess\AdvancedNovaMediaLibrary\Fields\Images;
use Whitecube\NovaFlexibleContent\Concerns\HasMediaLibrary;
use Dwarfhq\NovaFlexibleContent\Concerns\HasMediaLibrary;

class SliderLayout extends Layout implements HasMedia
{
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CreateCast.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Whitecube\NovaFlexibleContent\Commands;
namespace Dwarfhq\NovaFlexibleContent\Commands;

use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CreateLayout.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Whitecube\NovaFlexibleContent\Commands;
namespace Dwarfhq\NovaFlexibleContent\Commands;

use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CreatePreset.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Whitecube\NovaFlexibleContent\Commands;
namespace Dwarfhq\NovaFlexibleContent\Commands;

use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CreateResolver.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Whitecube\NovaFlexibleContent\Commands;
namespace Dwarfhq\NovaFlexibleContent\Commands;

use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
Expand Down
18 changes: 9 additions & 9 deletions src/Concerns/HasFlexible.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Whitecube\NovaFlexibleContent\Concerns;
namespace Dwarfhq\NovaFlexibleContent\Concerns;

use Illuminate\Support\Collection as BaseCollection;
use Laravel\Nova\NovaServiceProvider;
use Whitecube\NovaFlexibleContent\Layouts\Collection;
use Whitecube\NovaFlexibleContent\Layouts\Layout;
use Whitecube\NovaFlexibleContent\Value\FlexibleCast;
use Dwarfhq\NovaFlexibleContent\Layouts\Collection;
use Dwarfhq\NovaFlexibleContent\Layouts\Layout;
use Dwarfhq\NovaFlexibleContent\Value\FlexibleCast;

trait HasFlexible
{
Expand All @@ -15,7 +15,7 @@ trait HasFlexible
*
* @param string $attribute
* @param array $layoutMapping
* @return \Whitecube\NovaFlexibleContent\Layouts\Collection
* @return \Dwarfhq\NovaFlexibleContent\Layouts\Collection
*/
public function flexible($attribute, $layoutMapping = [])
{
Expand All @@ -29,7 +29,7 @@ public function flexible($attribute, $layoutMapping = [])
*
* @param array $value
* @param array $layoutMapping
* @return \Whitecube\NovaFlexibleContent\Layouts\Collection
* @return \Dwarfhq\NovaFlexibleContent\Layouts\Collection
*/
public function cast($value, $layoutMapping = [])
{
Expand All @@ -45,7 +45,7 @@ public function cast($value, $layoutMapping = [])
*
* @param mixed $value
* @param array $layoutMapping
* @return \Whitecube\NovaFlexibleContent\Layouts\Collection
* @return \Dwarfhq\NovaFlexibleContent\Layouts\Collection
*/
public function toFlexible($value, $layoutMapping = [])
{
Expand Down Expand Up @@ -104,7 +104,7 @@ protected function getMappedFlexibleLayouts(array $flexible, array $layoutMappin
*
* @param mixed $item
* @param array $layoutMapping
* @return null|Whitecube\NovaFlexibleContent\Layouts\LayoutInterface
* @return null|Dwarfhq\NovaFlexibleContent\Layouts\LayoutInterface
*/
protected function getMappedLayout($item, array $layoutMapping)
{
Expand Down Expand Up @@ -144,7 +144,7 @@ protected function getMappedLayout($item, array $layoutMapping)
* @param string $key
* @param array $attributes
* @param array $layoutMapping
* @return \Whitecube\NovaFlexibleContent\Layouts\LayoutInterface
* @return \Dwarfhq\NovaFlexibleContent\Layouts\LayoutInterface
*/
protected function createMappedLayout($name, $key, $attributes, array $layoutMapping)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Concerns/HasMediaLibrary.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Whitecube\NovaFlexibleContent\Concerns;
namespace Dwarfhq\NovaFlexibleContent\Concerns;

use Ebess\AdvancedNovaMediaLibrary\Fields\Media;
use Illuminate\Support\Collection;
Expand All @@ -10,9 +10,9 @@
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Exceptions\InvalidUrl;
use Spatie\MediaLibrary\MediaCollections\MediaRepository;
use Whitecube\NovaFlexibleContent\FileAdder\FileAdderFactory;
use Whitecube\NovaFlexibleContent\Flexible;
use Whitecube\NovaFlexibleContent\Layouts\Layout;
use Dwarfhq\NovaFlexibleContent\FileAdder\FileAdderFactory;
use Dwarfhq\NovaFlexibleContent\Flexible;
use Dwarfhq\NovaFlexibleContent\Layouts\Layout;

trait HasMediaLibrary
{
Expand Down
12 changes: 6 additions & 6 deletions src/FieldServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace Whitecube\NovaFlexibleContent;
namespace Dwarfhq\NovaFlexibleContent;

use Illuminate\Support\ServiceProvider;
use Laravel\Nova\Events\ServingNova;
use Laravel\Nova\Nova;
use Whitecube\NovaFlexibleContent\Commands\CreateCast;
use Whitecube\NovaFlexibleContent\Commands\CreateLayout;
use Whitecube\NovaFlexibleContent\Commands\CreatePreset;
use Whitecube\NovaFlexibleContent\Commands\CreateResolver;
use Whitecube\NovaFlexibleContent\Http\Middleware\InterceptFlexibleAttributes;
use Dwarfhq\NovaFlexibleContent\Commands\CreateCast;
use Dwarfhq\NovaFlexibleContent\Commands\CreateLayout;
use Dwarfhq\NovaFlexibleContent\Commands\CreatePreset;
use Dwarfhq\NovaFlexibleContent\Commands\CreateResolver;
use Dwarfhq\NovaFlexibleContent\Http\Middleware\InterceptFlexibleAttributes;

class FieldServiceProvider extends ServiceProvider
{
Expand Down
2 changes: 1 addition & 1 deletion src/FileAdder/FileAdder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Whitecube\NovaFlexibleContent\FileAdder;
namespace Dwarfhq\NovaFlexibleContent\FileAdder;

use Spatie\MediaLibrary\MediaCollections\FileAdder as OriginalFileAdder;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
Expand Down
4 changes: 2 additions & 2 deletions src/FileAdder/FileAdderFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Whitecube\NovaFlexibleContent\FileAdder;
namespace Dwarfhq\NovaFlexibleContent\FileAdder;

use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\MediaCollections\FileAdderFactory as OriginalFileAdderFactory;
use Whitecube\NovaFlexibleContent\FileAdder\FileAdder as NewFileAdder;
use Dwarfhq\NovaFlexibleContent\FileAdder\FileAdder as NewFileAdder;

class FileAdderFactory extends OriginalFileAdderFactory
{
Expand Down
30 changes: 15 additions & 15 deletions src/Flexible.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

namespace Whitecube\NovaFlexibleContent;
namespace Dwarfhq\NovaFlexibleContent;

use Laravel\Nova\Fields\Field;
use Laravel\Nova\Fields\SupportsDependentFields;
use Laravel\Nova\Http\Requests\NovaRequest;
use Whitecube\NovaFlexibleContent\Http\ScopedRequest;
use Whitecube\NovaFlexibleContent\Layouts\Collection as LayoutsCollection;
use Whitecube\NovaFlexibleContent\Layouts\Layout;
use Whitecube\NovaFlexibleContent\Layouts\LayoutInterface;
use Whitecube\NovaFlexibleContent\Layouts\Preset;
use Whitecube\NovaFlexibleContent\Value\Resolver;
use Whitecube\NovaFlexibleContent\Value\ResolverInterface;
use Dwarfhq\NovaFlexibleContent\Http\ScopedRequest;
use Dwarfhq\NovaFlexibleContent\Layouts\Collection as LayoutsCollection;
use Dwarfhq\NovaFlexibleContent\Layouts\Layout;
use Dwarfhq\NovaFlexibleContent\Layouts\LayoutInterface;
use Dwarfhq\NovaFlexibleContent\Layouts\Preset;
use Dwarfhq\NovaFlexibleContent\Value\Resolver;
use Dwarfhq\NovaFlexibleContent\Value\ResolverInterface;

class Flexible extends Field
{
Expand All @@ -27,7 +27,7 @@ class Flexible extends Field
/**
* The available layouts collection
*
* @var Whitecube\NovaFlexibleContent\Layouts\Collection
* @var Dwarfhq\NovaFlexibleContent\Layouts\Collection
*/
protected $layouts;

Expand All @@ -41,7 +41,7 @@ class Flexible extends Field
/**
* The field's value setter & getter
*
* @var Whitecube\NovaFlexibleContent\Value\ResolverInterface
* @var Dwarfhq\NovaFlexibleContent\Value\ResolverInterface
*/
protected $resolver;

Expand Down Expand Up @@ -229,7 +229,7 @@ public function collapsed(bool $value = true)
/**
* Push a layout instance into the layouts collection
*
* @param Whitecube\NovaFlexibleContent\Layouts\LayoutInterface $layout
* @param Dwarfhq\NovaFlexibleContent\Layouts\LayoutInterface $layout
* @return void
*/
protected function registerLayout(LayoutInterface $layout)
Expand Down Expand Up @@ -459,7 +459,7 @@ protected function buildGroups($resource, $attribute)
* Find an existing group based on its key
*
* @param string $key
* @return \Whitecube\NovaFlexibleContent\Layouts\Layout
* @return \Dwarfhq\NovaFlexibleContent\Layouts\Layout
*/
protected function findGroup($key)
{
Expand All @@ -473,7 +473,7 @@ protected function findGroup($key)
*
* @param string $layout
* @param string $key
* @return \Whitecube\NovaFlexibleContent\Layouts\Layout
* @return \Dwarfhq\NovaFlexibleContent\Layouts\Layout
*/
protected function newGroup($layout, $key)
{
Expand Down Expand Up @@ -616,7 +616,7 @@ protected static function registerValidationKeys(array $rules)
* Return a previously registered validation key
*
* @param string $key
* @return null|\Whitecube\NovaFlexibleContent\Http\FlexibleAttribute
* @return null|\Dwarfhq\NovaFlexibleContent\Http\FlexibleAttribute
*/
public static function getValidationKey($key)
{
Expand All @@ -633,7 +633,7 @@ protected function registerOriginModel($model)
{
if (is_a($model, \Laravel\Nova\Resource::class)) {
$model = $model->model();
} elseif (is_a($model, \Whitecube\NovaPage\Pages\Template::class)) {
} elseif (is_a($model, \Dwarfhq\NovaPage\Pages\Template::class)) {
$model = $model->getOriginal();
}

Expand Down
Loading

0 comments on commit 2896342

Please sign in to comment.