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.
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.
统计信息
- 总下载量: 137
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-04