我通过互联网搜索了这个问题,我按照说明(我看到的每个网站)但我有一个问题,这个错误"类'App\Http\Controllers\Auth\Registered'not found".我的控制器中是否缺少代码?我该如何解决这种错误?
我的控制器
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
use App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use App\Http\Requests;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* …Run Code Online (Sandbox Code Playgroud) 我正在做更新方法。当我尝试更新特定数据时,我收到此错误“调用数组上的成员函数 save()”。为什么?我的代码中是否缺少某些内容?
我还尝试 print_r $result 变量,它有一个值..
看法
@extends('dashboard')
@section('content')
<br><br>
<div class="x_content">
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>Text Header</th>
<th>Text Description</th>
<th>Action</th>
<th>Updated At</th>
<th>Created At</th>
</tr>
</thead>
<tbody>
@foreach($data as $text)
<tr>
<th scope="row">{{ $text->id }}</th>
<td>{{ $text->text_header}}</td>
<td>{!! nl2br(e($text->text_description)) !!}</td>
<td><button class = "btn btn-info btn-md" data-toggle="modal" data-target="#myModal-{{$text->id}}"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</button></td>
<div class="modal fade" id="myModal-{{$text->id}}" tabindex="-1" role="dialog" aria-labelledby="titleLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header modal-header-success">
<button type="button" class="close btn btn-primary" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span></button>
<h4 …Run Code Online (Sandbox Code Playgroud) 我们使用的是 dompdf 版本 0.8.3。我们在报告中使用它,我们希望通过在每个页面的底部添加一些标题和页码来改进我们的报告。
目前,我们有页码,我们想要一些标题。
控制器
<!-- My other function/data -->
$pdf = PDF::loadView('purchase-order.export.export-pdf', $data)->setPaper('a4');
$pdf->getDomPDF()->set_option("enable_php", true);
return $pdf->stream('purchase-order-'.$purchase_order->number.'.pdf');
Run Code Online (Sandbox Code Playgroud)
@extends('layouts.formpdf')
@section('content')
<div id="page-wrap">
<script type="text/php">
if (isset($pdf)) {
$x = 550;
$y = 800;
$text = "{PAGE_NUM}";
$font = null;
$size = 12;
$color = array(255,0,0);
$word_space = 0.0; // default
$char_space = 0.0; // default
$angle = 0.0; // default
$pdf->page_text($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle);
}
</script>
.......
</div>
Run Code Online (Sandbox Code Playgroud)
问题:如何在每个页面中添加一些标题?
我目前正在开发一个系统.我已经在我的登录模块中完成了但我想进行一些登录尝试.用户只有3次登录尝试,如果超过3次限制,该用户的电子邮件将被停用,否则将被罚5分钟.
我不知道如何开始它,但我知道的事情; 您需要获取用户的IP地址,检查该电子邮件的尝试次数.
用户表
name (varchar)
email (varchar)
password (varchar)
confirm password (varchar)
attempts (int)
ip_address (varchar)
status (varchar)
Run Code Online (Sandbox Code Playgroud)
调节器
public function login()
{
if($this->form_validation->run('login_validate') == FALSE)
{
echo json_encode(validation_errors());
}
else
{
$email = clean_data($this->input->post('email'));
$password = clean_data($this->input->post('password'));
$where = array('email'=>$email);
$get_user = $this->Crud_model->fetch_tag_row('*','users',$where);
if($get_user)
{
$check_password = $get_user->password;
if($this->session->tempdata('penalty'))
{
echo json_encode("Your account is ". $_SESSION['penalty']. " on penalty");
}
else
{
if(password_verify($password,$check_password))
{
if($get_user->status == 'Active')
{
$user_session = [
'id' => $get_user->id,
'first_name' => $get_user->first_name,
'middle_name' …Run Code Online (Sandbox Code Playgroud) 我现在正在学习 Symfony 4。我试图让自己熟悉这个框架。例如在 Laravel 中有 php artisan make:controller PhotoController..
注意:我试过了
php app/console generate:controller or
php app/console generate:controller <name>
Run Code Online (Sandbox Code Playgroud)
它给了我一个错误
Could not open input file: app/console
Run Code Online (Sandbox Code Playgroud)
当我尝试这个时
php bin/console generate:controller or php bin/console generate:controller <name>
It gives me an error "There are no commands defined in the generate namespace"
Run Code Online (Sandbox Code Playgroud)
问题:是否有任何命令可以使用方法创建控制器,以便我不再输入
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
Run Code Online (Sandbox Code Playgroud) 我是symfony的新手,试图研究条件语句。在我的for循环中添加所有总和有困难。
问题:我该如何解决值“ =“(预期为“打印声明结束”)的错误“意外令牌“操作符”,并且我可能知道发生此错误的原因?(以供将来参考)
我的树枝文件
<!DOCTYPE html>
<html>
<head>
<title>{{ title }} </title>
</head>
<body>
{% set number1 = 2 %}
{% set number2 = 1 %}
{% set total = 0 %}
{# If-else condition#}
<!-- {% if number1 > number2 %}
{{ "Number 1 is greater than to number 2"}}
{% else %}
{{ "Number 2 is greater than to number 1"}}
{% endif %} -->
{# If-elseif-else condition #}
<!--
{% if number1 == number2 %}
{{ "Number …Run Code Online (Sandbox Code Playgroud) 我是 ruby on Rails 的新手。当用户单击特定产品的购买按钮时,它将获取该产品的 id,然后它将重定向到另一个页面,其中将显示该产品的所有详细信息(名称、描述) 、价格、图片等)..
我创建了一个自定义路线,如下所示:
路线
resources :products do // products is my name of the controller
collection do
get :details
end
end
Run Code Online (Sandbox Code Playgroud)
看法
<%= button_to 'Add to Cart',details_products_path, class: 'btn btn-primary', method: :get %>
Run Code Online (Sandbox Code Playgroud)
控制器
class ProductsController < ApplicationController
def index
@products = Product.all()
end
def details
@product = Product.find(params[:id])
end
end
Run Code Online (Sandbox Code Playgroud)
注意:我还检查了我的耙子路线,它显示的路径
details_products_path GET /products/details(.:format) products#details
Run Code Online (Sandbox Code Playgroud)
我注意到没有 id(比如 /products/details/:id)
我也尝试过这个
<%= button_to 'Add to Cart',details_products_path(@products), class: 'btn btn-primary', method: :get %>
Run Code Online (Sandbox Code Playgroud)
但我收到错误
“ActiveRecord::RecordNotFound in ProductsController#details”无法找到带有 …
我目前正在做一个系统。系统中有一个叫做manage resident的模块;如果居民是单身,已婚和有孩子(例如名字,中间名和姓氏),管理居民将在这里获得居民的信息。
我已经完成了添加或创建新的常驻部分,我现在在编辑常驻部分。当我点击编辑驻留时,我遇到了错误
where 子句中的列“id”不明确
我有 3 张桌子:居民、已婚和孩子。居民ID是已婚的外键,而已婚ID是孩子表的外键。
我的每个表的数据示例(列主键、外键、名字、中间名、姓氏
Resident -> id, Testing, Testing, Testing
Married -> Married_id, resident_id, Testing, Testing, Testing
Children -> id, married_id, Testing, Testing, Testing
Run Code Online (Sandbox Code Playgroud)
问题:我怎样才能得到选定居民的孩子?然后在我的视图中将其单独显示在我的字段中。
控制器
$id = $this->uri->segment(4);
$get_children = $this->Crud_model->get_children($id);
Run Code Online (Sandbox Code Playgroud)
模型
public function get_children($id){
$this->db->select('*');
$this->db->from('resident');
$this->db->where('id',$id);
$this->db->join('married', 'resident.id = married.resident_id');
$this->db->join('children', 'resident.id = children.married_id');
$query = $this->db->get();
return $query->row();
}
Run Code Online (Sandbox Code Playgroud)
看法
<?php $explode = explode(",",$children->first_name); ?>
<div class="form-group">
<label>First Name</label>
<input type="text" class="form-control" name="child_fname" id="child_fname"><?= $explode?>
</div>
Run Code Online (Sandbox Code Playgroud)