【发布时间】:2021-12-29 09:48:54
【问题描述】:
我想从控制器中删除身份验证系统。
这是我的控制器代码。
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\rfq;
use App\Models\customer_rfq;
class ShowRfqController extends Controller
{
public function inforfq($name)
{
$rfq = rfq::find($name);
return view('frontend.sellershowrfq',compact('rfq'));
}
public function customer_inforfq($name)
{
$customer_rfq = customer_rfq::find($name);
return view('frontend.customershowrfq',compact('customer_rfq'));
}
}
这是我的模型代码。
这是 customer_rfq 模型的代码。
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class customer_rfq extends Model
{
use HasFactory;
protected $table = 'customer_rfq';
protected $fillable = [
'name',
'description',
'Price',
'MobileNo',
'quantity',
'image',
];
}
这是rfq模型的代码。
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App;
class rfq extends Model
{
use HasFactory;
protected $table = 'rfq';
protected $fillable = [
'name',
'description',
'Price',
'MobileNo',
'quantity',
'image'
];
}
这是我的观点代码。
这是我的客户rfqshow.blade.php 查看代码。
@extends('frontend.layouts.app')
@section('content')
<section class="mb-4 pt-3">
<div class="container">
<div class="bg-white shadow-sm rounded p-3">
<div style="margin-left: 50px; margin-top: 35px;" class="row">
<div class="col-xl-5 col-lg-6 mb-4">
<div class="sticky-top z-3 row gutters-10">
<div class="col order-1 order-md-2">
<div class="aiz-carousel product-gallery" data-nav-for='.product-gallery-thumb' data-fade='true' data-auto-height='true'>
<div class="carousel-box img-zoom rounded">
<img class="img-fluid lazyload" src="{{ static_asset('assets/img/placeholder.jpg') }}" data-src="{{ uploaded_asset($customer_rfq->image) }}" onerror="this.onerror=null;this.src='{{ static_asset('assets/img/placeholder.jpg') }}';" >
</div>
</div>
</div>
</div>
</div>
<div class="col">
<h2 style="text-transform: capitalize;">
<b> {{ $customer_rfq->name }} </b>
</h2>
<hr>
<div class="col-sm-2">
<div class="opacity-50 my-2" style="font-size: 15px;1">{{ translate('Approx Price')}}:
</div>
</div>
<div class="col-sm-10">
<h2 style="color: red; font-style:;" name="price">
<b> Rs. {{ $customer_rfq->Price }}.00/- </b>
</h2>
</div>
<hr>
<div class="col-sm-2">
<div class="opacity-50 my-2" style="font-size: 15px;">{{ translate('Quantity')}}:
</div>
</div>
<div class="col-sm-10">
<h2 style="color: red; font-style:;" name="quantity">
<b>{{ $customer_rfq->quantity }}</b>
</h2>
</div>
<hr>
<div class="col-sm-2">
<div class="opacity-50 my-2" style="font-size: 15px;1">{{ translate('Total Price')}}:
</div>
</div>
<div class="col-sm-10">
<h2 style="color: red; font-style:;">
<b>Rs. {{ $customer_rfq->quantity*$customer_rfq->Price }}.00/-</b>
</h2>
</div>
<div class="row no-gutters mt-4">
<div class="col-sm-2">
<div class="opacity-50 my-2">{{ translate('Share')}}:</div>
</div>
<div class="col-sm-10">
<div class="aiz-share"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
这是我的sellershoerfq.blade.php 查看代码。
@extends('frontend.layouts.app')
@section('content')
<section class="mb-4 pt-3">
<div class="container">
<div class="bg-white shadow-sm rounded p-3">
<div style="margin-left: 50px; margin-top: 35px;" class="row">
<div class="col-xl-5 col-lg-6 mb-4">
<div class="sticky-top z-3 row gutters-10">
<div class="col order-1 order-md-2">
<div class="aiz-carousel product-gallery" data-nav-for='.product-gallery-thumb' data-fade='true' data-auto-height='true'>
<div class="carousel-box img-zoom rounded">
<img class="img-fluid lazyload" src="{{ static_asset('assets/img/placeholder.jpg') }}" data-src="{{ uploaded_asset($rfq->image) }}" onerror="this.onerror=null;this.src='{{ static_asset('assets/img/placeholder.jpg') }}';" >
</div>
</div>
</div>
</div>
</div>
<div class="col">
<h2 style="text-transform: capitalize;">
<b> {{ $rfq->name }} </b>
</h2>
<hr>
<div class="col-sm-2">
<div class="opacity-50 my-2" style="font-size: 15px;">{{ translate('Approx Price')}}:
</div>
</div>
<div class="col-sm-10">
<h2 style="color: red; font-style:;" name="price">
<b> Rs. {{ $rfq->Price }}.00/- </b>
</h2>
</div>
<hr>
<div class="col-sm-2">
<div class="opacity-50 my-2" style="font-size: 15px;">{{ translate('Quantity')}}:
</div>
</div>
<div class="col-sm-10">
<h2 style="color: red; font-style:;" name="quantity">
<b>{{ $rfq->quantity }}</b>
</h2>
</div>
<hr>
<div class="col-sm-2">
<div class="opacity-50 my-2" style="font-size: 15px;">{{ translate('Total Price')}}:
</div>
</div>
<div class="col-sm-10">
<h2 style="color: red; font-style:;">
<b>Rs. {{ $rfq->quantity*$rfq->Price }}.00/-</b>
</h2>
</div>
<div class="row no-gutters mt-4">
<div class="col-sm-2">
<div class="opacity-50 my-2">{{ translate('Share')}}:</div>
</div>
<div class="col-sm-10">
<div class="aiz-share"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
当我运行127.0.0.1:8080/inforfq/1 时,这会将我重定向到登录页面。
我如何从127.0.0.1:8080/inforfq/1 中删除身份验证系统。
【问题讨论】:
-
很多代码......你的“路线”代码是什么?
-
请修剪您的代码,以便更容易找到您的问题。请按照以下指南创建minimal reproducible example。
标签: php laravel authentication controller laravel-8