I Newly Installed Laravel 5.3. I Create Model and Controller for Role table. When i send Insert Data to Role Controller. It will be display Blank Page. but print a posted will be display. Select Query will be working but insert query not working.
Controller :
<?php namespace App\Http\Controllers;
use Auth;
use DB;
use App\Role;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
class UserController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function index()
{
return view('admin.userlist');
}
public function roleindex()
{
return view('admin.role');
}
public function saveRole(request $request)
{
$id=Auth::user()->id;
$role=new Role;
$role->role_title=$request->input('role');
$role->created_by=$id;
$role->created_date=date('Y-m-d H:i:s');
$role->save();
$request->session()->flash('alert-success','Role details Saved Successfully!');
return redirect('dddddd');
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire