Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Revert "Update MOTD package: improve package description and update c…
Browse files Browse the repository at this point in the history
…onfiguration"

This reverts commit d0d54a4.
  • Loading branch information
Lexian-droid committed Mar 10, 2024
1 parent 05352ee commit 47ca4ce
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 72 deletions.
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/lexiandev/laravel-motd/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/lexiandev/laravel-motd/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/lexiandev/laravel-motd.svg?style=flat-square)](https://packagist.org/packages/lexiandev/laravel-motd)

This is a simple package to display MOTD messages to your users, it can
be used to display updates, maintenance messages, or any other message
you want to display to your users.
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

When using the package, simply call the `get` method on the motd model
and it'll return the **newest** message that is not expired.
## Support us

[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/laravel-motd.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/laravel-motd)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

## Installation

Expand All @@ -23,33 +26,34 @@ composer require lexiandev/laravel-motd
You can publish and run the migrations with:

```bash
php artisan vendor:publish --tag="motd-migrations"
php artisan vendor:publish --tag="laravel-motd-migrations"
php artisan migrate
```

You can publish the config file with:

```bash
php artisan vendor:publish --tag="motd-config"
php artisan vendor:publish --tag="laravel-motd-config"
```

This is the contents of the published config file:

```php
return [
/**
* The default text that will be displayed if no MOTD is set.
* Default: Null; no message will be returned.
*/
'default_message' => null,
];
```

Optionally, you can publish the views using

```bash
php artisan vendor:publish --tag="laravel-motd-views"
```

## Usage

```php
$motd = new Motd();
return $motd->get();
$motd = new Lexiandev\Motd();
echo $motd->echoPhrase('Hello, Lexiandev!');
```

## Testing
Expand All @@ -63,7 +67,7 @@ composer test
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security Vulnerabilities
Expand Down
6 changes: 1 addition & 5 deletions config/motd.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@

// config for Lexiandev/Motd
return [
/**
* The default text that will be displayed if no MOTD is set.
* Default: Null; no message will be returned.
*/
'default_message' => null,

];
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ return new class extends Migration
{
public function up()
{
Schema::create('motds', function (Blueprint $table) {
Schema::create('laravel_motd_table', function (Blueprint $table) {
$table->id();

$table->string('message');
Expand Down
50 changes: 0 additions & 50 deletions src/Models/motd.php

This file was deleted.

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

namespace Lexiandev\Motd;

class Motd
{
}
2 changes: 1 addition & 1 deletion src/MotdServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function configurePackage(Package $package): void
->name('laravel-motd')
->hasConfigFile()
->hasViews()
->hasMigration('create_motds_table')
->hasMigration('create_laravel-motd_table')
->hasCommand(MotdCommand::class);
}
}

0 comments on commit 47ca4ce

Please sign in to comment.