Skip to content

Commit

Permalink
Clean up unsed files and fix morph relation
Browse files Browse the repository at this point in the history
  • Loading branch information
leopoletto committed Dec 16, 2020
1 parent f8480cd commit c4c1c65
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Add meta attributes to Eloquent models
# Laravel Meta Attributes

[![Latest Version on Packagist](https://img.shields.io/packagist/v/nncodes/laravel-meta-attributes.svg?style=flat-square)](https://packagist.org/packages/nncodes/laravel-meta-attributes)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/nncodes/laravel-meta-attributes/run-tests?label=tests)](https://github.com/99codes/laravel-meta-attributes/actions?query=workflow%3ATests+branch%3Amaster)
Expand Down
9 changes: 3 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"nncodes",
"laravel-meta-attributes"
],
"homepage": "https://github.com/nncodes/laravel-meta-attributes",
"homepage": "https://github.com/99codes/laravel-meta-attributes",
"license": "MIT",
"authors": [
{
"name": "Leonardo Poletto",
"email": "[email protected]",
"homepage": "https://spatie.be",
"homepage": "https://99codes.com.br",
"role": "Developer"
}
],
Expand Down Expand Up @@ -47,10 +47,7 @@
"laravel": {
"providers": [
"Nncodes\\MetaAttributes\\MetaAttributesServiceProvider"
],
"aliases": {
"MetaAttributes": "Nncodes\\MetaAttributes\\MetaAttributesFacade"
}
]
}
},
"minimum-stability": "dev",
Expand Down
19 changes: 19 additions & 0 deletions database/factories/ModelFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Nncodes\MetaAttributes\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

/*
class ModelFactory extends Factory
{
protected $model = YourModel::class;
public function definition()
{
return [
];
}
}
*/
2 changes: 1 addition & 1 deletion src/Concerns/HasMetaAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ trait HasMetaAttributes
{
public function metaAttributes()
{
return $this->morphOne(MetaAttribute::class, 'model');
return $this->morphMany(MetaAttribute::class, 'model');
}

public function setMetaAttribute(string $key, $value)
Expand Down
7 changes: 0 additions & 7 deletions src/MetaAttributes.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/MetaAttributesFacade.php

This file was deleted.

5 changes: 0 additions & 5 deletions src/MetaAttributesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Nncodes\MetaAttributes;

use Illuminate\Support\ServiceProvider;
use Nncodes\MetaAttributes\Commands\MetaAttributesCommand;

class MetaAttributesServiceProvider extends ServiceProvider
{
Expand All @@ -24,10 +23,6 @@ public function boot()
__DIR__ . "/../database/migrations/{$migrationFileName}.stub" => database_path('migrations/' . date('Y_m_d_His', time()) . '_' . $migrationFileName),
], 'migrations');
}

$this->commands([
MetaAttributesCommand::class,
]);
}

$this->loadViewsFrom(__DIR__ . '/../resources/views', 'meta-attributes');
Expand Down

0 comments on commit c4c1c65

Please sign in to comment.