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

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

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

douglas-spindola/laravel-inspiring-quotes

最新稳定版本:0.1.1

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.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固