#Laravel 5.1 利用 Seeder 生成测试数据(范例)
php artisan make:model Lesson -m
class CreateLessonsTable extends Migration
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
在 app/Providers/AppServiceProvider.php 的boot()方法加上:
\Carbon\Carbon::setLocale('zh');
#2. Model Factory 生成本地化数据 在 AppServiceProvider.php boot() 方法内加入如下内容:
#如何一步一步打造高可扩展性的应用程序? 随着项目的规模越来越大,项目的维护性可能会变得越来越差,有时可能会出现牵一发而动全身的情况。如果需要修改某个功能的代码,就会耗费大量的人力和时间。此时,高可扩展性、低耦合的应用程序就变得非常重要了。构建高扩展性的应用的要点在于构建组成该应用的小的、单个的模块。 编写自包含、自封装、不影响其他组件的代码,最大化地减少依赖。利用一系列用于架构解耦和测试的工具,以及各种设计模式解决方案。比如依赖注入(dependency injection)、观察者模式(observer pattern)、中介者模式(mediator pattern)、外观模式(facade pattern)、命令模式(command pattern),面向对象(OOP)工具集。
http://www.csdn.net/article/2013-07-22/2816305-scalable-testable-maintainable-application
#如何保证Web应用程序安全性? Web应用程序是当今多数企业应用的前沿阵地。本文分析了保障Web应用程序的安全未必意味着延长开发周期以及如何保证Web应用程序安全性。
#软件设计中的易用性
#实现定时任务(范例) ##1. php artisan make:console LogInfo ##2. 在项目Console/Commands 文件夹下编辑 LogInfo.php
protected $signature = 'lesson:log';
protected $description = 'Log Info';
public function handle(){
\Log::info('It Works'); //这里你可以实现自己的定时任务功能逻辑
The content of this article is from Vinay Sahni's Best Practices for Designing a Pragmatic RESTFul API. Really enjoyed this article!
some requirements that the API must strive for: