mac使用cli3构建项目_您可以使用这些软件包构建CLI图像绘图Laravel应用程序吗?

mac使用cli3构建项目

It’s time for our monthly hunt for new open source libraries to use and contribute to!

现在该是我们每月一次寻找使用新的开源库并做出贡献的时候了

If you’re new to Sourcehunt, it’s our monthly post for promoting open source projects that seem interesting or promising and could use help in terms of Github stars or pull requests.

如果您是Sourcehunt的新手,这是我们的月度帖子,用于推广看起来有趣或有前途的开源项目,这些项目可以在Github明星或请求请求方面使用帮助。

It’s our way of giving back – promoting projects that we use (or could use) so that they gain enough exposure to attract a wider audience, a powerful community and, possibly, new contributors or sponsors.

这是我们回馈的方式-推广我们使用(或可以使用)的项目,使它们获得足够的曝光度,以吸引更广泛的受众,强大的社区,并可能吸引新的贡献者或赞助者。

Sourcehunt logo


laracademy /互动式制作 [216★] (laracademy/interactive-make [216 ★])

Laravel Interactive Make is a plugin that lets you use Laravel’s make command interactively, without being verbose about exactly what it is you want to generate, as the following gif demonstrates:

Laravel Interactive Make是一个插件,它使您可以交互地使用Laravel的make命令,而不必确切说明要生成的内容,如以下gif所示:

Gif of Laravel Interactive Make in action

The tool will ask you about commands and sub-commands until you reach a point at which you’re happy with what got generated. No more looking up make commands!

该工具将询问您有关命令和子命令的信息,直到您对所生成的内容感到满意为止。 不再需要查找make命令!

There’s some issues to take care of, so get to helping!

有一些问题需要解决 ,因此请务必帮助!



reibengu / laravel自动验证 [45★] (reibengu/laravel-auto-validation [45 ★])

This package will let you remove all manual validation from Laravel Controllers, and instead rely on automatic validation that kicks instantly into action as a given controller and method are called – all you need to do is use the package’s trait in a controller, and set the service provider. Then, you define rules like so:

该软件包可让您从Laravel控制器中删除所有手动验证,而依赖于自动验证,该自动验证在调用给定控制器和方法时立即生效-您要做的就是在控制器中使用软件包的特征,并设置服务提供者。 然后,您定义如下规则:

$rules = [
    'UserController' => [
        'register' => [
            'name'     => 'required|max:255',
            'email'    => ['required', 'email', 'max:255', Rule::unique('users')->where('status', 1)],
            'password' => 'required|min:6|confirmed',
            'gender'   => 'required|in:male,female',
            'birthday' => 'required|date_format:Y-n-j',
        ],
        'update' => function ($request) {
            return [
                'name'     => 'required|max:255',
                'email'    => 'required|email|max:255|unique:users,email,'.$request->user()->id,
                'gender'   => 'required|in:male,female',
                'birthday' => 'required|date_format:Y-n-j',
            ];
        },
    ],
];

return ['rules' => $rules];

The remainder of the process is automatic, and if validation fails, the request is automatically redirected back to the page from where it came, with error messages about validation flashed into session.

该过程的其余部分是自动的,如果验证失败,则该请求将自动重定向回原来的页面,有关验证的错误消息会闪入会话中。

The project has no outstanding issues or pull requests, but why not add some? Here’s an idea: make it dead easy to customize these error messages, and integrate them with Laravel’s translator.

该项目没有未解决的问题或请求请求,但是为什么不添加一些呢? 这是一个想法:轻松自定义这些错误消息,并将其与Laravel的翻译器集成起来非常简单。



delight-im / PHP-PrivacyPolicy [26★] (delight-im/PHP-PrivacyPolicy [26 ★])

In what’s a somewhat oddball case, PHP-PrivacyPolicy is a tool which programmatically generates a privacy policy and related documents for apps and digital tools and resources, in both human readable and machine oriented form.

在有些古怪的情况下,PHP-PrivacyPolicy是一种工具,可以以人类可读和面向机器的形式 ,以编程方式为应用程序,数字工具和资源生成隐私策略和相关文档。

Go ahead and add another paragraph or two you think might be needed one day, or even turn it into a SaaS and let people generate the policies online.

继续,添加一天您可能需要的另一两段,甚至将其变成SaaS,然后让人们在线生成策略。



ozh / git评分 [7★] (ozh/git-score [7 ★])

Inspired by the Python-based git-score, this command-line installable tool can be executed inside cloned repos on your machine in order to calculate information about contributors, and assign scores to all the people involved.

受基于Python的git-score的启发,可以在您计算机上的克隆存储库中执行此命令行可安装工具,以计算有关贡献者的信息,并将分数分配给所有相关人员。

Here’s an example output, as taken from their README:

这是一个示例输出,取自他们的自述文件:

$ git score
name              commits  delta    (+)    (-)  files
Ozh                  2230  47906  66188  18282    500
Léo Colombaro         145   1038  15438  14400     84
lesterchan             43    553   1366    813     24
Nic Waller             13    322    434    112      5
BestNa.me Labs         12     10     21     11      4
Preovaleo              11     -5     28     33      7
Clayton Daley           9     13     29     16      2
Diftraku                8      0     16     16      8
Audrey                  4     10     21     11      4

No outstanding issues or PRs, but it would probably be fun to upgrade it with some extra stats to track – for example, a console based render of the activity for each user, similar to the activity graph on Github.com would be quite cool.

没有悬而未决的问题或PR,但是升级它并添加一些额外的统计数据可能会很有趣-例如,基于控制台的每个用户活动的呈现,类似于Github.com上的活动图,将非常不错。



香蕉/ PHPloy [1,119★] (banago/PHPloy [1,119 ★])

PHPloy, deserves a mention here despite being quite a popular package already. PHPloy solves a very familiar pain point in deploying via (S)FTP, where users seldom know exactly which files they had changed, so they often opt to just re-upload the whole project. At the beginning, this doesn’t really matter, but as the project grows, the complexity of incremental updates grows exponentially with it, and why would one waste time on this when it’s so easy to use Git’s existing functionality to do it?

尽管已经很流行,PHPloy在这里仍然值得一提。 PHPloy解决了通过(S)FTP进行部署时一个非常熟悉的痛点,即用户很少确切知道他们已更改哪些文件,因此他们通常选择重新上传整个项目。 刚开始时,这并不重要,但是随着项目的发展,增量更新的复杂性也随之成倍增长,为什么在使用Git的现有功能非常容易的时候就浪费时间呢?

PHPloy detects changes between commits and only pushes the changed files online. It supports multiple servers, submodules, and rollbacks.

PHPloy会检测两次提交之间的更改,并且仅将更改的文件在线推送。 它支持多个服务器,子模块和回滚。



joseluisq / gimage [112★] (joseluisq/gimage [112 ★])

Gimage, another issue and PR-free package, is a tool for fluent building of images with PHP and the native GD library (extension).

Gimage是另一个问题且无PR软件包,它是使用PHP和本地GD库(扩展名)流畅构建图像的工具。

Gimage provides a fluent interface for editing and drawing images and is little more than a very natural-sounding human-readable abstraction around GD’s native methods.

Gimage提供了一个流畅的界面来编辑和绘制图像,并且仅仅是关于GD本地方法的听起来很自然的人类可读抽象。

For example, here’s how to draw a green ellipse:

例如,以下是绘制绿色椭圆的方法:

use GImage\Figure;

// Setting ellipse sizes
$ellipse = new Figure(500, 300);
$ellipse
    // Set ellipse type
    ->isEllipse()
    // Setting a green RGB color
    ->setBackgroundColor(170, 188, 147)
    // Creating the figure
    ->create()
    // Outputting image (PNG Figure by default) on the browser.
    ->output();

And here’s how to draw this image:

这是绘制此图像的方法:

Example image made by Gimage
<?php

use GImage\Image;
use GImage\Text;
use GImage\Figure;
use GImage\Canvas;

$avatar_image = new Image();
$avatar_image
    ->load('http://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?s=100.jpg')
    ->setTop(60)
    ->setLeft(70);

$about_text = new Text("MY AWESOME PRESENTATION CARD GENERATED WITH GIMAGE");
$about_text
    ->setSize(16)
    ->setWidth(300)
    ->setLeft(210)
    ->setTop(75)
    ->setColor(204, 164, 116)
    ->setFontface('fonts/Lato-Light.ttf');

$twitter_text = new Text('@username');
$twitter_text
    ->setSize(11)
    ->setWidth(70)
    ->setLeft(450)
    ->setTop(210)
    ->setColor(130, 127, 125)
    ->setFontface('fonts/Lato-Regular.ttf');

$canvas_figure = new Figure(550, 250);
$canvas_figure
    ->setBackgroundColor(47, 42, 39)
    ->create();

$avatar_box = new Figure($avatar_image->getWidth() + 16, $avatar_image
    ->getHeight() + 17);
$avatar_box
    ->setBackgroundColor(63, 56, 52)
    ->setLeft($avatar_image->getLeft() - 7)
    ->setTop($avatar_image->getTop() - 8)
    ->create();

$avatar_box2 = new Figure($avatar_image->getWidth() + 3, $avatar_image
    ->getHeight() + 19);
$avatar_box2
    ->setBackgroundColor(79, 72, 67)
    ->setLeft($avatar_image->getLeft() + 7)
    ->setTop($avatar_image->getTop() - 9)
    ->create();

$avatar_box3 = new Figure(120, 240);
$avatar_box3
    ->setBackgroundColor(63, 56, 52)
    ->create();

$line_vertical = new Figure(600, 10);
$line_vertical
    ->setBackgroundColor(119, 99, 77)
    ->setTop(240)
    ->create();

$line_horizontal = new Figure(1, 240);
$line_horizontal
    ->setBackgroundColor(79, 72, 67)
    ->setLeft(120)
    ->create();

$canvas = new Canvas($canvas_figure);
$canvas
    ->append([
      $line_horizontal,
      $avatar_box2,
      $avatar_box3,
      $avatar_box,
      $avatar_image,
      $about_text,
      $twitter_text,
      $line_vertical
    ])
    ->toPNG()
    ->draw()
    ->save('./card.png');

Further examples can be seen here.

在这里可以看到更多示例。

The library needs more usage examples, so get to it!

该库需要更多用法示例,请继续阅读!



That’s it for May. Found anything you could sink your teeth into?

五月就这样。 发现什么可以让您的牙齿陷入其中?

As always, please throw your links at us with the #sourcehunt hashtag! If you build something with the projects we’ve mentioned, or if you submit an elaborate pull request you’d like to talk about, give us a shout and we’ll make sure the world knows about it!

与往常一样,请使用#sourcehunt标签将您的链接扔给我们! 如果您使用我们提到的项目构建项目,或者提交您想谈论的详尽请求请求,请向我们喊叫,我们将确保全世界都知道!

Like last time, (that challenge remains unclaimed, by the way – there’s $500 in it for you if you do it!), we’re using the above packages for inspiration on creating a potentially useful app or two:

上次一样,(顺便提一句,这个挑战仍然无人能解决,如果您这样做,其中有500美元会给您!),我们正在使用上述软件包来启发您创建一两个可能有用的应用程序:

App+Tutorial idea(s) of the month:

本月的App + Tutorial想法:

  • an app which uses interactive make to add a new “draw image” command, and interactively asks the user about the kind of image to draw, using Gimage. The user’s input should be validated with auto-validation.

    一个使用交互式make来添加新的“绘制图像”命令的应用程序,并使用Gi​​mage交互地询问用户要绘制的图像类型。 用户的输入应使用自动验证进行验证。
  • or, an app which lets people generate privacy policies interactively with PHP-PrivacyPolicy, and is deployed with PHPloy – a tutorial around all that.

    或者,该应用程序使人们可以使用PHP-PrivacyPolicy交互生成隐私策略,并与PHPloy一起部署-有关所有内容的教程。

Get in touch to find out how much these are worth to us!

联系我们,以了解这些对我们来说有多少价值!

Happy coding!

祝您编码愉快!

翻译自: https://www.sitepoint.com/can-you-build-a-cli-image-drawing-laravel-app-with-these-packages/

mac使用cli3构建项目

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值