контроллеру:
Код: Выделить всё
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SellauthController extends Controller
{
protected function validator(array $data)
{
return Validator::make($data, [
'storename' => 'required|string|max:255',
'city3' => 'required|string|min:5|max:100',
'storelocation' => 'required|string|max:255',
'pannumber' => 'numeric',
'vatnumber' => 'numeric',
'productcat' => 'required|string|max:255',
]);
}
protected function create(array $data)
{
$userid = (!Auth::guest()) ? Auth::user()->id : null ;
return Sellauths::create([
'userid' => $userid,
'storename' => $data['store-name'],
'storelocation' => $data['city3'].$data['store-location'],
'pannumber' => $data['store-pan'],
'vatnumber' => $data['store-vat'],
'productcat' => $data['store-product-types'],
'active' => 0,
]);
return User::update([
'usercat' => 'sells',
]);
}
}
Код: Выделить всё
{{ csrf_field() }}
Register as a seller
:
:
Код: Выделить всё
namespace App;
use Illuminate\Database\Eloquent\Model;
class sellauth extends Model
{
use Notifiable;
protected $fillable = [
'userid','storename', 'storelocation', 'pannumber', 'vatnumber', 'productcat', 'usercat', 'blocksell', 'active'
];
}
Код: Выделить всё
// subpage to create a post found at /admin/posts/create (app/views/admin/posts-create.blade.php)
Route::get('/', function()
{
return View::make('layouts.controlpanel')->with('pg', 'dashboard');
});
Route::get('/dashboard', function()
{
return View::make('layouts.controlpanel')->with('pg', 'dashboard');
});
Route::get('/dashboard/sellregister', function(){
return View::make('layouts.controlpanel')->with('pg', 'sellregister');
});
Route::post('/dashboard/sellregistered', 'SellauthController');
/*
function(){
return redirect('member/dashboard/sellregister')->with('status', 'Successfully Submited');
});
Код: Выделить всё
route::auth();