laravel的解决方案

对form表单批量去掉前后空格trim:

$request->merge(array_map('trim', $request->all()));
或
Input::merge(array_map('trim', Input::all()));

  

Laravel中执行Linux SSH命令使用symfony的process

http://symfony.com/doc/current/components/process.html

use SymfonyComponentProcessProcess;

$process = new Process('ls -lsa');
$process->run();

// executes after the command finishes
if (!$process->isSuccessful()) {
    throw new RuntimeException($process->getErrorOutput());
}

echo $process->getOutput();

Laravel中添加定时任务

找到文件laravel5appConsoleKernel.php

protected function schedule(Schedule $schedule)
   {
       $schedule->call('FullNamespaceYourController@method')
                ->hourly();
   }