Answer the question
In order to leave comments, you need to log in
Why can't render template from laravel controller?
Hello! I need to render a template from a laravel controller. It seems that everything is working correctly, but the controller simply does not render the page, no error pops up! Just a blank page. Such a page exists in a folder and is rendered if called. Here is the controller code:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Redirect;
use DB;
class UserController extends Controller
{
public function index_reg(Request $request) {
if($this->check()) {
} else {
$this->validation($request);
}
}
public function user_reg(Request $request) {
}
public function check() {
if(isset($_COOKIE['remember_token']) && $_COOKIE['remember_token'] != null) {
return true;
} else {
return false;
}
}
public function validation(Request $request) {
$login = $request->input('login');
$email = $request->input('email');
$password = $request->input('password');
$r_password = $request->input('r_password');
$about = $request->input('about_me');
$text_error = '';
$errors = false;
$users = DB::table('users')->where('login', $login)->orwhere('email', $email)->count();
if ($users > 0) {
$text_error = 'Пользователь с таким логином или Email уже зарегистрирован.';
$errors = true;
} else {
if (strlen($login) < 6 OR strlen($login) > 10) {
$text_error = 'Длина логина должна быть не менее 6 символов и не больше 10.';
$errors = true;
} else {
if ($r_password != $password) {
$text_error = 'Пароли должны совпадать совпадают.';
$errors = true;
} else {
if (strlen($password) < 6 OR strlen($password) > 10) {
$text_error = 'Длина пароля должна быть не менее 6 символов и не больше 10.';
$errors = true;
} else {
$this->user_reg($request);
}
}
}
}
if ($errors) {
return view('Main')->with('text_error', 'Victoria');
}
}
}
if ($errors) {
return view('Main')->with('text_error', 'Victoria');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question