定制 douglas-spindola/laravel-inspiring-quotes 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

douglas-spindola/laravel-inspiring-quotes

Composer 安装命令:

composer require douglas-spindola/laravel-inspiring-quotes

包简介

Um pacote Laravel para fornecer citações inspiradoras

README 文档

README

A simple Laravel package that provides motivational and inspirational quotes for your application. Easily integrate meaningful quotes into your Laravel project, enhancing the user experience with wisdom and positivity.

g1

Installation

You can install the package via Composer:

composer require douglas-espindola/laravel-motivational-quotes

Usage

Once the package is installed, you can start using it by importing the Inspiring class and calling the quoteInPortuguese method:

use DouglasSpindola\LaravelInspiringQuotes\Inspiring;

$quote = Inspiring::quoteInPortuguese();
echo $quote;

Example with Inertia.js

If you're using Inertia.js, you can pass the quote to a frontend component like this:

Route::get('/dashboard', function () {
    return Inertia::render('Dashboard', [
        'quote' => Inspiring::quoteInPortuguese(),
    ]);
})->middleware(['auth', 'verified'])->name('dashboard');

And then in your Dashboard component:

import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout';
import { Head } from '@inertiajs/react';
import Inspire from "@/Pages/Inspire.jsx";

export default function Dashboard({ auth, quote }) {
    return (
        <AuthenticatedLayout
            user={auth.user}
            header={<h2 className="font-semibold text-xl text-gray-800 leading-tight">Dashboard</h2>}
        >
            <Head title="Dashboard" />

            <div className="py-12">
                <div className="max-w-7xl mx-auto sm:px-6 lg:px-8">
                    <div className="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                        <div className="p-6 text-gray-900"><Inspire quote={quote} /></div>
                    </div>
                </div>
            </div>
        </AuthenticatedLayout>
    );
}

Customization

You can customize the package by adding your own quotes. Just modify the quotes method inside the Inspiring class and add your new quotes to the array. These quotes will then be randomly selected and displayed:

protected static function quotes()
{
    return Collection::make([
        'Your new custom quote here.',
        // Add more quotes here...
    ]);
}

Contribution

Contributions are welcome! If you have suggestions or find any issues, feel free to open a pull request or submit an issue on the GitHub repository.

License

This package is open-source software licensed under the MIT license.

douglas-spindola/laravel-inspiring-quotes 适用场景与选型建议

douglas-spindola/laravel-inspiring-quotes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 350 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 09 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 douglas-spindola/laravel-inspiring-quotes 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

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