Skip to content

Commit

Permalink
fixing class naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
swilla committed Apr 1, 2024
1 parent fcd9bdc commit a5a0ae3
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 72 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ php artisan vendor:publish --tag="filament-maillog-views"
## Usage

```php
$filamentMaillog = new Tapp\FilamentMaillog();
echo $filamentMaillog->echoPhrase('Hello, Tapp!');
$FilamentMailLog = new Tapp\FilamentMailLog();
echo $FilamentMailLog->echoPhrase('Hello, Tapp!');
```

## Testing
Expand All @@ -76,8 +76,8 @@ Please review [our security policy](../../security/policy) on how to report secu

## Credits

- [Steve Williamson](https://github.com/swilla)
- [All Contributors](../../contributors)
- [Steve Williamson](https://github.com/swilla)
- [All Contributors](../../contributors)

## License

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
},
"autoload": {
"psr-4": {
"Tapp\\FilamentMaillog\\": "src/",
"Tapp\\FilamentMaillog\\Database\\Factories\\": "database/factories/"
"Tapp\\FilamentMailLog\\": "src/",
"Tapp\\FilamentMailLog\\Database\\Factories\\": "database/factories/"
}
},
"autoload-dev": {
"psr-4": {
"Tapp\\FilamentMaillog\\Tests\\": "tests/",
"Tapp\\FilamentMailLog\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/"
}
},
Expand Down Expand Up @@ -73,10 +73,10 @@
"extra": {
"laravel": {
"providers": [
"Tapp\\FilamentMaillog\\FilamentMaillogServiceProvider"
"Tapp\\FilamentMailLog\\FilamentMailLogServiceProvider"
],
"aliases": {
"FilamentMaillog": "Tapp\\FilamentMaillog\\Facades\\FilamentMaillog"
"FilamentMailLog": "Tapp\\FilamentMailLog\\Facades\\FilamentMailLog"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion config/filament-maillog.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

// config for Tapp/FilamentMaillog
// config for Tapp/FilamentMailLog
return [

];
4 changes: 1 addition & 3 deletions database/factories/ModelFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?php

namespace Tapp\FilamentMaillog\Database\Factories;
namespace Tapp\FilamentMailLog\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

/*
class ModelFactory extends Factory
{
protected $model = YourModel::class;
Expand All @@ -16,4 +15,3 @@ public function definition()
];
}
}
*/
36 changes: 36 additions & 0 deletions database/migrations/create_filament_mail_log_table.php.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up()
{
Schema::create('mail_logs', function (Blueprint $table) {
$table->increments('id');
$table->dateTime('date');
$table->string('from')->nullable();
$table->string('to')->nullable();
$table->string('cc')->nullable();
$table->string('bcc')->nullable();
$table->string('subject');
$table->text('body');
$table->text('headers')->nullable();
$table->longText('attachments')->nullable();
$table->uuid('message_id')->nullable();
$table->string('status')->nullable();
$table->longText('data')->nullable();
$table->timestamp('opened')->nullable();
$table->timestamp('delivered')->nullable();
$table->timestamp('complaint')->nullable();
$table->timestamp('bounced')->nullable();

$table->timestamps();

$table->index('message_id');
$table->index('status');
});
}
};
19 changes: 0 additions & 19 deletions database/migrations/create_filament_maillog_table.php.stub

This file was deleted.

19 changes: 0 additions & 19 deletions src/Commands/FilamentMaillogCommand.php

This file was deleted.

8 changes: 4 additions & 4 deletions src/Facades/FilamentMaillog.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

namespace Tapp\FilamentMaillog\Facades;
namespace Tapp\FilamentMailLog\Facades;

use Illuminate\Support\Facades\Facade;

/**
* @see \Tapp\FilamentMaillog\FilamentMaillog
* @see \Tapp\FilamentMailLog\FilamentMailLog
*/
class FilamentMaillog extends Facade
class FilamentMailLog extends Facade
{
protected static function getFacadeAccessor(): string
{
return \Tapp\FilamentMaillog\FilamentMaillog::class;
return \Tapp\FilamentMailLog\FilamentMailLog::class;
}
}
7 changes: 7 additions & 0 deletions src/FilamentMailLog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Tapp\FilamentMailLog;

class FilamentMailLog
{
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php

namespace Tapp\FilamentMaillog;
namespace Tapp\FilamentMailLog;

use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use Tapp\FilamentMaillog\Commands\FilamentMaillogCommand;

class FilamentMaillogServiceProvider extends PackageServiceProvider
class FilamentMailLogServiceProvider extends PackageServiceProvider
{
public function configurePackage(Package $package): void
{
Expand All @@ -19,7 +18,6 @@ public function configurePackage(Package $package): void
->name('filament-maillog')
->hasConfigFile()
->hasViews()
->hasMigration('create_filament-maillog_table')
->hasCommand(FilamentMaillogCommand::class);
->hasMigration('create_filament-mail_log_table');
}
}
7 changes: 0 additions & 7 deletions src/FilamentMaillog.php

This file was deleted.

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

namespace Tapp\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class MailLog extends Model
{
use HasFactory;

protected $guarded = [];

protected $casts = [
'data' => 'array',
];
}
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

use Tapp\FilamentMaillog\Tests\TestCase;
use Tapp\FilamentMailLog\Tests\TestCase;

uses(TestCase::class)->in(__DIR__);
8 changes: 4 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Tapp\FilamentMaillog\Tests;
namespace Tapp\FilamentMailLog\Tests;

use Illuminate\Database\Eloquent\Factories\Factory;
use Orchestra\Testbench\TestCase as Orchestra;
use Tapp\FilamentMaillog\FilamentMaillogServiceProvider;
use Tapp\FilamentMailLog\FilamentMailLogServiceProvider;

class TestCase extends Orchestra
{
Expand All @@ -13,14 +13,14 @@ protected function setUp(): void
parent::setUp();

Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'Tapp\\FilamentMaillog\\Database\\Factories\\'.class_basename($modelName).'Factory'
fn (string $modelName) => 'Tapp\\FilamentMailLog\\Database\\Factories\\'.class_basename($modelName).'Factory'
);
}

protected function getPackageProviders($app)
{
return [
FilamentMaillogServiceProvider::class,
FilamentMailLogServiceProvider::class,
];
}

Expand Down

0 comments on commit a5a0ae3

Please sign in to comment.