search
HomeBackend DevelopmentPHP Tutorial人人必备的10个 Laravel 4 扩展包

Laravel 是一个非常流行且简单易用的PHP框架,它提供了很多基础的工具(如 RESTful 路由、内置的ORM、模版等)使你能够快速的创建应用。这意味着你可以花费更少的时间来建立应用程序的模版,给你更多的时间写你的Web应用程序。

下面我们列出了10个必备的 Laravel 4 扩展包,它们可以为你的Laravel WEB应用程序引入很多通用的功能,而不用你自己去实现,这意味着你不用花费大量的时间在那些共同的部分(如认证、调试、网站优化等)。列表基于 Packagist 下载量排名。

1. Laravel Generators

在编写WEB应用程序时,很常见的事情是:构建新的模型、视图、控制器和其他模块。手动的创建这些工作非常的繁琐。使用Laravel Generators,你可以通过几个简单的PHP Artisan命令简化这些操作,提高生产力。

2. Laravel IDE Helper

Laravel IDE Helper会为你的IDE生成一个文件,提供更加精准的补全功能。这个文件会根据你项目中的文件来生成,所以它永远都是实时更新的。此外,你还可以使用pre-generated helper file,但它不是最新的。这让你在编写程序时减少查看文档的时间。

3. Behat

简单的来说,Behat是一个有利于测试你的 laravel 应用程序的PHP框架。它允许你在Larave应用程序中使用行为驱动开发过程,使得编写行为测试更加的简单。如果你想遵循BDD的模式并且你在这种模式下开发效率更高,这个将非常有用。

4. Ardent

Ardent 为 Laravel 内置的 Eloquent ORM 提供了自我验证的智能模型。以一种更加容易理解的方式说,就是它允许你在模型中定义验证规则,而不是在视图中。这会使得视图文件变小,很长的验证规则被写入到模型中,你可以简单的定义模型而不需要担心视图中大量的验证。

5. Laravel Debug Bar

Laravel Debug Bar 使得调试更加的简单,所以你不再需要在你的代码中使用 var_dump() 。这使得调试更快、更简单,使你更加有效率。

6. Confide

在大部分的应用程序中,都会有一些基本的认证,如注册、登录、退出、重置密码等等。编写这些代码的过程需要时间,并且如果不注意还可能会导致安全问题。使用 Confide ,你不需要写任何代码就能获得所有这些基本的认证功能。为你省出更多的时间来编写应用程序。

7. Entrust

WEB应用程序第二个重要的功能就是基于角色的权限控制。通常,你会让某一特定角色的用户能够使用某个功能。实例就是很多应用程序都有“管理员”和“普通用户”。Entrust 让你不在需要写 RBAC 系统,你需要做的就是定义一些角色,然后根据它们过滤路由。

8. Former

所有的应用程序中,表单都是很常见的。如果你的应用中有任何类型的用户交互,它们通常都会使用表单。然而,最后维护它们会很痛苦。Former 使得在PHP中定义表单更加的容易,并且使用你常用的CSS框架(Bootstrap或Foundation)来渲染他们。这让你维护表单更加容易且有效。

9. Laravel HTML Minify

最简单的减小页面大小的方法就是压缩HTML源代码。Laravel HTML Minify 让你除了为程序添加一个 provider 外不需要任何其他操作,就可以获得高达18%的压缩率。很小的工作量就能获得显著的性能提升。

10. Laravel Administrator

管理界面几乎是任何web应用程序的需求。基本的管理界面通常是非常简单的,但是它却是一个额外的重复性的工作。Laravel Administrator 扩展包为你提供了一个简单的后台管理系统,让你更加专注于WEB应用程序的开发而不是后台管理功能。

更多扩展包

Laravel 中有丰富的扩展包来帮你完成几乎任何你想实现的功能。我们不能把所有的扩展包都整理出来,然而,这里还是列出了一些很有用的。

总之,你几乎总是能够找到一个扩展包可以解决你当前的问题。因此,在写代码之前先做一些研究,因为很可能有人已经实现了你正要准备解决的问题,这是非常有用的。我们希望能够覆盖大部分有用的扩展包,然而,如果我们漏掉了哪些,请在留言中回复让我们知道。

via:vexxhost,本文由 Specs 翻译整理,发布在 Coder资源网,转载请注明来源。

学习Laravel的朋友可以看看《Laravel教程学习系列笔记

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Continued Use of PHP: Reasons for Its EnduranceThe Continued Use of PHP: Reasons for Its EnduranceApr 19, 2025 am 12:23 AM

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python: Exploring Their Similarities and DifferencesPHP and Python: Exploring Their Similarities and DifferencesApr 19, 2025 am 12:21 AM

PHP and Python are both high-level programming languages ​​that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP and Python: Different Paradigms ExplainedPHP and Python: Different Paradigms ExplainedApr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: A Deep Dive into Their HistoryPHP and Python: A Deep Dive into Their HistoryApr 18, 2025 am 12:25 AM

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

Choosing Between PHP and Python: A GuideChoosing Between PHP and Python: A GuideApr 18, 2025 am 12:24 AM

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP and Frameworks: Modernizing the LanguagePHP and Frameworks: Modernizing the LanguageApr 18, 2025 am 12:14 AM

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHP's Impact: Web Development and BeyondPHP's Impact: Web Development and BeyondApr 18, 2025 am 12:10 AM

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

How does PHP type hinting work, including scalar types, return types, union types, and nullable types?How does PHP type hinting work, including scalar types, return types, union types, and nullable types?Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.