laravelがphpとjavascriptを
縦横無尽に使える両刃の剣と聞いたんだけど
web.appからアクションindexを呼び出して、
「$this->name=文字列」をいれたら
アクションwriteの$this->nameが別のモノに
なってるとか、オブジェクト指向としてオカしすぎる。

---MainController.php---

namespace 略
use Illuminate\Http\Request;

class MainController extends controller{
public function index(){
$this->name="TAROU";
/*処理A*/
}
}
class public write(){
$who=$this->name;
/*処理B*/
}
}

---wep.app---

Route::get('/test','MainController@index');
Route::post('/test','MainController@write');