承接 kakposoe/laravel-placeholder-image 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kakposoe/laravel-placeholder-image

Composer 安装命令:

composer require kakposoe/laravel-placeholder-image

包简介

A laravel placeholder image

README 文档

README

Build Status StyleCI

A convenient laravel facade which returns a placeholder image url.

Installation

Install via composer

composer require kakposoe/laravel-placeholder-image

Register Service Provider

If you use Laravel < 5.5, Add service provider to config/app.php in providers section

Kakposoe\LaravelViewGenerator\LaravelViewGeneratorServiceProvider::class,

Register Facade

If you use Laravel < 5.5, register package facade in config/app.php in aliases section

Kakposoe\LaravelPlaceholderImage\Facades\LaravelPlaceholderImage::class,

Publish Configuration File

php artisan vendor:publish --provider="Kakposoe\LaravelPlaceholderImage\ServiceProvider" --tag="config"

How to use

You can get a placeholder image url within your blade templates by adding:

{{ PlaceholderImage::get($width = null, $height = null) }}

By default, images will be returned as a 600px x 400px image.

To change the dimensions of the image, simply add the $width and $height like so:

{{ PlaceholderImage::get(300, 300) }}

Other image types

There are several different types of image at your disposal:

Profile Image

To get a profile image placeholder:

<img src="{{ PlaceholderImage::profile($width = null, $height = null) }}">

Icon image

You are able to create a placeholder image with a font-awesome icon in the middle:

<img src="{{ PlaceholderImage::icon('arrow-up') }}">

Note: By default, the fa-image icon will be returned.

Blurry image

To return a blurry image:

<img src="{{ PlaceholderImage::blur($width = null, $height = null) }}">

Keyword search

You can return a placeholder url based on a keyword:

<img src="{{ PlaceholderImage::keyword('food') }}">

Placeholder with image dimensions

An placeholder image url which has the image dimensions can be returned using the ::dimensions() method:

<img src="{{ PlaceholderImage::dimensions($width = null, $height = null) }}">

A note about production environments

As these are placeholder images, it is assumed that these should not to be used within production environments.

All placeholder images used in production will be replaced with an ::icon() placeholder image, avoiding showing inappropriate images and the impression that the image could not be found.

Credits

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固