blakvghost/bravo 问题修复 & 功能扩展

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

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

blakvghost/bravo

Composer 安装命令:

composer create-project blakvghost/bravo

包简介

Bravo is a personal project, a mini MVC framework in PHP that I developed while drawing the best points from Laravel, Symfony and the Node.js side. I like simplicity, so I decided to make a simple product. For the moment, I manage the Route, the middlewares, the CORS, the easy sending of mails, as w

README 文档

README

Bravo is a personal project, a mini MVC framework in PHP that I developed while drawing the best points from Laravel, Symfony and the Node.js side. I like simplicity, so I decided to make a simple product. For the moment, I manage the Route, the middlewares, the CORS, the easy sending of mails, as well as a mini ORM.

Packagist Version (custom server) Packagist Version (custom server) Packagist Version (custom server)

Documentation

Documentation for Bravo is being prepared and will be available soon. Stay tuned for updates! For the moment refer to the documentation or the source code of the Framework Core (Juste).

How to use

To see an example of using Bravo, you can refer to the Bravo-mailer project. It serves as a demonstration project and will have official documentation soon.

Requirements

Installation

To install Bravo, you can either go through composer or through github

composer

  1. Create the project with composer
composer create-project blakvghost/bravo <project-name>

github

  1. Clone the project repository from GitHub by running the following command:
git clone https://github.com/BlakvGhost/Bravo.git
  1. After cloning the repository, navigate to the project directory:
cd Bravo
  1. Install the project dependencies by running the following command:
composer install
  1. Once the dependencies are installed, you can start using Bravo in your PHP project.

By cloning the project repository, you will have the complete Bravo framework and all its dependencies available in your project directory. This allows you to customize and extend Bravo according to your needs.

Please note that you will need to have Git and Composer installed on your system for this installation method to work.

If you encounter any issues during the installation process, please make sure to check the project's documentation or reach out to the project's author for support

Start Server

For the moment use the php server by following these steps:

  1. Make sure you have php >= 8.0 and have php in your session environment variables for Windows users

  2. Open your terminal or command prompt in the project directory:

cd <project-name>
  1. start php server on public folder:
php -s -S localhost:8000 -t ./public
  1. Open your browser and head to localhost:8000 or change the port

Usage Examples

Routing

<?php

namespace Routes;

use App\Controllers\WelcomeController;
use Juste\Facades\Routes\Route;

Route::get("/", [WelcomeController::class, 'welcome'])->name('welcome');
Route::resource('password', WelcomeController::class);


Route::group(function () {
    
})->middlewares(['auth']);

require_once 'api.php';

API Route

<?php

namespace Routes;

use App\Controllers\MailsController;
use Juste\Facades\Routes\Route;

Route::post('api/mails', [MailsController::class, 'index'])->name('api')->middlewares(['cors']);

Middleware

<?php

namespace App\Middleware;

use Juste\Http\Middleware\MiddlewareInterface;
use Juste\Facades\Controllers\Controller as Helpers;

class Authenticate extends Helpers implements MiddlewareInterface
{

    public function handle(): mixed
    {
        if (!$this->user()) {
            return $this->redirect('login');
        }
        return 1;
    }
}

Model

<?php

namespace App\Models;

class User extends Model
{
    protected $table = 'users';

    protected $fillable = ['nom', 'prenom', 'email', 'password'];
}

Controller

<?php

namespace App\Controllers;

use App\Controllers\Controller;
use Juste\Facades\Mails\JusteMailer;

class MailsController extends Controller
{
    public function __construct()
    {
        $this->mustAuthenticate(false);
    }

    public function index()
    {
        $mail = new JusteMailer();

        $object = [
            'to' => 'dev@kabirou-alassane.com',
            'subject' => 'Message d\'un potentiel client',
        ];

        $data = [
            'name' => $this->input('name', "Anonymous"),
            'email' => $this->input('email', "anonymous@anonymous.com"),
            'subject' => $this->input('subject', "Anonyme"),
            'message' => $this->input('message', "Anonyme"),
        ];

        $mail->view('mails/contact', $data)->sendEmail($object);
        return $this->back();
    }
}

Authors

Support

For support, you can reach out to me by email at dev@kabirou-alassane.com. Feel free to contact me if you have any questions or need assistance with Bravo.

License

This project is licensed under the MIT License.

blakvghost/bravo 适用场景与选型建议

blakvghost/bravo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 4, 最近一次更新时间为 2023 年 07 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 blakvghost/bravo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 blakvghost/bravo 我们能提供哪些服务?
定制开发 / 二次开发

基于 blakvghost/bravo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-08