patrikjak/utils 问题修复 & 功能扩展

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

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

patrikjak/utils

最新稳定版本:2.8.2

Composer 安装命令:

composer require patrikjak/utils

包简介

A simple utility package for Laravel

README 文档

README

codecov

The Utils package is a versatile utility toolkit designed to enhance Laravel applications. It provides a variety of reusable classes and functions to streamline development, including CSS and JavaScript assets to support frontend components like buttons, modals, and tables. Easily integrate the package into your project, publish assets, and selectively include only the styles and functions you need for a highly customizable setup. Perfect for Laravel developers seeking to simplify their workflow with ready-to-use utilities.

Table of Contents

What's included:

  • CSS - A collection of reusable styles for buttons, modals, tables, and more.
  • JavaScript - A variety of functions to enhance user experience and streamline development.
  • Forms - A set of form components to simplify form creation.
  • Tables - A collection of table components to enhance data presentation.
  • Modals - A set of modal components to display content in a modal window.
  • Notifications - A collection of notification components to display messages to users.

You can find the full documentation here.

Installation

Install the package via Composer:

composer require patrikjak/utils

Setup

After installing the package, add the package provider to the providers array in bootstrap/providers.php.

use Patrikjak\Utils\UtilsServiceProvider;
 
return [
    ...
    UtilsServiceProvider::class,
];

Next, publish the package assets:

php artisan vendor:publish --tag="assets" --force

Usage

The Utils package offers a variety of useful classes and functions.

CSS

To include all component styles, add the main.css file:

<link rel="stylesheet" href="{{ asset('vendor/pjutils/assets/main.css') }}">

You need to set border-box box-sizing for all elements in your CSS file to prevent layout issues:

* {
    box-sizing: border-box;
}

JavaScript

This package does not include a compiled JavaScript file. Instead, import and call functions directly within your main JavaScript file.

Refer to the documentation for a list of available functions and usage examples.

Dependencies

Utils requires the following dependencies to function properly:

npm install i18n-js axios

To load correct language for JS you need to set lang attribute to html tag

<html lang="{{ config('app.locale') }}">

Currently supported languages are:

  • en
  • sk

You will need to set up Vite build target to esnext in your vite.config.js file:

export default defineConfig({
    ...
    build: {
        target: 'esnext',
    },
});

统计信息

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

GitHub 信息

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

其他信息

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