anasnasr/site-downer-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anasnasr/site-downer-laravel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require anasnasr/site-downer-laravel

包简介

A Laravel package to display a customizable site down overlay.

README 文档

README

Site Downer Laravel is a Laravel package that allows developers to easily display a customizable "site down" overlay message when needed, such as when payments are overdue. This overlay provides a simple way to notify site owners about payment issues without taking the entire site offline.

Features

Display an optional "site down" overlay on all pages. Fully customizable overlay message and design. Easy-to-use configuration options. Compatible with Laravel 8.x, 9.x, and 10.x.

Author

Name: Anas Nasr
Email: anasn5020@gmail.com
GitHub: anasn5020

Installation

Step 1: Install via Composer

Run the following command in your Laravel project directory:
composer require anasnasr/site-downer-laravel

Step 2: Register the Service Provider

If you're using Laravel 7.x or earlier, manually register the service provider in config/app.php by adding this line to the providers array:
Anasnasr\SiteDownerLaravel\PaymentCheckerServiceProvider::class,
For Laravel 8.x and above, this step is not required as the package uses auto-discovery.

Step 3: Publish Configuration and Views

Publish the configuration file and views using the following commands:

php artisan vendor:publish --tag=config
php artisan vendor:publish --tag=views

Step 4: Configure the Environment

Add the following variables to your .env file to activate the overlay and customize the message:
PAYMENT_CHECKER_ACTIVE=true
PAYMENT_CHECKER_MESSAGE="Payment is pending. Please contact the developer."
Configuration
The configuration file config/paymentchecker.php provides the following default options:
return [ 'active' => env('PAYMENT_CHECKER_ACTIVE', false), 'message' => env('PAYMENT_CHECKER_MESSAGE', 'Please contact the developer to clear payments.'), ];

Usage

When PAYMENT_CHECKER_ACTIVE is set to true, the "site down" overlay will appear across all pages. The overlay message can be customized via the PAYMENT_CHECKER_MESSAGE environment variable. Customizing the Overlay The default overlay view is located in resources/views/vendor/paymentchecker/overlay.blade.php. Feel free to edit this file to match your design or add custom styles.

Compatibility

Laravel 8.x, 9.x, and 10.x are fully supported. Requires PHP 7.4, 8.0, or above.

License

This package is open-source and licensed under the MIT License. See the LICENSE file for details.

Contribution

Contributions are welcome! To report issues or submit pull requests, visit the GitHub repository.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-12