страница админки сапорта прописал в роут Код (Text): Route::group(['middleware' => 'auth', 'middleware' => 'access:admin'], function () { Route::get('/admin/support', 'AdminController@sup'); Route::get('/admin/support/{id}/close', 'AdminController@sup_close');}); } в контролере Код (Text): public function sup() { $a = \DB::table('support')->where('status', 0)->get(); foreach($a as $b) { $user = User::where('id', $b->user_id)->first(); $b->username = $user->username; $b->avatar = $user->avatar; $b->login = $user->login; $b->ban = $user->ban_support; } return view('admin.pages.support', compact('a')); } public function sup_close($id, Request $r) { $support = Support::where('id', $id)->first(); $support->status = 1; $support->save(); $r->session()->flash('alert-success', 'Тикет успешно закрыт!'); return redirect()->back(); } САМА СТРАНИЦА АДМИНКИ Код (Text): @extends('admin') @section('content') <div class="page-bar"> <ul class="page-breadcrumb"> <li> <a href="/admin">Главная</a> <i class="fa fa-circle"></i> </li> <li> <span>Поддержка</span> </li> </ul> </div> <h1 class="page-title"> Поддержка </h1> <div class="flash-message"> @foreach (['danger', 'warning', 'success', 'info'] as $msg) @if(Session::has('alert-' . $msg)) <p class="alert alert-{{ $msg }}">{{ Session::get('alert-' . $msg) }} <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a></p> @endif @endforeach </div> <div class="row"> @foreach($a as $b) <div class="col-xs-12" style="background-color: #f3f3f3; border: 1px solid #aaa; margin-bottom: 20px;"> <div class="col-xs-1" style="margin-top: 20px; margin-bottom: 20px;"> <img src="{{ $b->avatar }}" alt="" class="img-circle" width="50px"> </div> <div class="col-xs-8" style="margin-top: 20px; margin-bottom: 20px;"> <span style="display: block;">Имя: <b>{{ $b->name }}</b></span> <span style="display: block;">E-mail: <b>{{ $b->email }}</b></span> <span style="display: block;">Тема: <b>{{ $b->theme }}</b></span> <span style="display: block;">Текст: <b>{{ $b->theme_text }}</b></span> @if($b->ban == 1) <span style="display: block; color: #6d0000;"><b>Пользователь забанен</b></span> @endif </div> <div class="col-xs-3" style="margin-top: 20px;"> <div class="col-xs-6" style="margin-bottom: 20px; text-align: center;"> <a href="https://vk.com/{{ $b->login }}" style="text-decoration:none;"><div class="btn-primary">Страница VK</div></a> </div> @if($b->ban == 0) <div class="col-xs-6" style="margin-bottom: 20px; text-align: center;"> <a href="/admin/user/{{ $b->user_id }}/ban" style="text-decoration:none;"><div class="btn-danger">Ban</div></a> </div> @endif <div class="col-xs-6" style="margin-bottom: 20px; text-align: center;"> <a href="/admin/support/{{ $b->id }}/close" style="text-decoration:none;"><div class="btn-success">Close Ticket</div></a> </div> </div> </div> @endforeach </div> @stop Подскажите что я сделал не так страница не работает
Ужасный код. Я так понимаю ты прям на сервере все пишешь с отключенными ошибками в редакторе без подсветки синтаксиса? Ну наверное роуты нужно перегенерировать. Зачем это тут?
<?php Route::get('/', 'PagesController@index'); Route::get('/faq', 'PagesController@faq'); Route::get('/garanties', 'PagesController@garanties'); Route::get('/support', 'PagesController@support'); Route::get('/terms', 'PagesController@terms'); Route::get('/bonus', 'PagesController@bonus'); Route:ost('/bonus', 'PagesController@activebonus'); Route::get('/case/{id}', 'PagesController@cases'); Route::get('/user/{id}', 'PagesController@users'); Route::get('/test', 'PagesController@test'); Route::get('/login', 'LoginController@vklogin'); /*Оплата*/ Route::get('/pay', 'PagesController@pay'); Route::get('/getPayment', 'PagesController@getPayment'); Route::get('/success', 'PagesController@success'); /*Оплата*/ /*API*/ Route::get('/ajax/get_rand', 'PagesController@get_rand'); Route::get('/ajax/refresh_balance', 'PagesController@refresh_balance'); Route::get('/ajax/get_drop', 'PagesController@get_drop'); Route::get('/ajax/get_drop_m', 'PagesController@get_drop'); Route::get('/cashout', 'PagesController@cashout'); Route:ost('/api/stats', 'PagesController@stats'); Route::get('/ajax/refresh_opens', 'PagesController@refresh_opens'); Route::get('/ajax/contact', 'PagesController@supports'); /*API*/ /*adminka*/ Route::group(['middleware' => 'auth', 'middleware' => 'access:admin'], function () { Route::get('/admin', ['as' => 'admin', 'uses' => 'AdminController@index']); /* Players */ Route::get('/admin/users', ['as' => 'users', 'uses' => 'AdminController@users']); Route:ost('/admin/user/save', ['as' => 'user.save', 'uses' => 'AdminController@user_save']); Route::get('/admin/user/{id}/edit', ['as' => 'user.edit', 'uses' => 'AdminController@edit_user']); Route::get('/admin/user/{id}/ban', 'AdminController@ban_user'); /* Settings */ Route::get('/admin/settings', ['as' => 'settings', 'uses' => 'AdminController@settings']); Route:ost('/admin/settings/save', ['as' => 'settings.save', 'uses' => 'AdminController@settings_save']); /* Cases */ Route::get('/admin/cases', ['as' => 'cases', 'uses' => 'AdminController@cases']); Route::get('/admin/new_case', ['as' => 'new_case', 'uses' => 'AdminController@new_case']); Route::get('/admin/case/{id}/edit', ['as' => 'case.edit', 'uses' => 'AdminController@case_edit']); Route::get('/admin/case/{id}/delete', ['as' => 'case.delete', 'uses' => 'AdminController@case_delete']); Route::get('/admin/item/{id}/add', ['as' => 'item.add', 'uses' => 'AdminController@item_add']); Route::get('/admin/item/{id}/edit', ['as' => 'item.edit', 'uses' => 'AdminController@item_edit']); Route::get('/admin/item/{id}/delete', ['as' => 'item.delete', 'uses' => 'AdminController@item_delete']); Route:ost('/admin/item/add', ['as' => 'item.save', 'uses' => 'AdminController@item_create']); Route:ost('/admin/item/update', ['as' => 'item.update', 'uses' => 'AdminController@item_update']); Route:ost('/admin/case/save', ['as' => 'case.save', 'uses' => 'AdminController@add_case']); Route:ost('/admin/case/update', ['as' => 'case.upd', 'uses' => 'AdminController@case_update']); /* Withdraw */ Route::get('/admin/withdraw', ['as' => 'withdraw', 'uses' => 'AdminController@withdraw']); Route:ost('/admin/withdraw/save', ['as' => 'withdraw.save', 'uses' => 'AdminController@withdraw_save']); Route::get('/admin/withdraw/{id}/edit', ['as' => 'withdraw.edit', 'uses' => 'AdminController@edit_withdraw']); /*Payments*/ Route::get('/admin/payments', 'AdminController@payments'); /*promocodes*/ Route::get('/admin/promocodes', 'AdminController@promocodes'); Route:ost('/admin/createpromo', 'AdminController@createpromo'); /*support*/ Route::get('/admin/support', 'AdminController@sup'); Route::get('/admin/support/{id}/close', 'AdminController@sup_close'); }); /*adminka*/ Route::group(['middleware' => 'auth'], function () { Route::get('/logout', 'LoginController@logout'); }); это весь код (скрипт не мой я просто переделываю дизайн) а именно в этом скрипте нету этой страницы --- Добавлено --- PHP: <?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ Route::get('/', 'PagesController@index'); Route::get('/faq', 'PagesController@faq'); Route::get('/garanties', 'PagesController@garanties'); Route::get('/support', 'PagesController@support'); Route::get('/terms', 'PagesController@terms'); Route::get('/bonus', 'PagesController@bonus'); Route::post('/bonus', 'PagesController@activebonus'); Route::get('/case/{id}', 'PagesController@cases'); Route::get('/user/{id}', 'PagesController@users'); Route::get('/test', 'PagesController@test'); Route::get('/login', 'LoginController@vklogin'); /*Оплата*/ Route::get('/pay', 'PagesController@pay'); Route::get('/getPayment', 'PagesController@getPayment'); Route::get('/success', 'PagesController@success'); /*Оплата*/ /*API*/ Route::get('/ajax/get_rand', 'PagesController@get_rand'); Route::get('/ajax/refresh_balance', 'PagesController@refresh_balance'); Route::get('/ajax/get_drop', 'PagesController@get_drop'); Route::get('/ajax/get_drop_m', 'PagesController@get_drop'); Route::get('/cashout', 'PagesController@cashout'); Route::post('/api/stats', 'PagesController@stats'); Route::get('/ajax/refresh_opens', 'PagesController@refresh_opens'); Route::get('/ajax/contact', 'PagesController@supports'); /*API*/ /*adminka*/ Route::group(['middleware' => 'auth', 'middleware' => 'access:admin'], function () { Route::get('/admin', ['as' => 'admin', 'uses' => 'AdminController@index']); /* Players */ Route::get('/admin/users', ['as' => 'users', 'uses' => 'AdminController@users']); Route::post('/admin/user/save', ['as' => 'user.save', 'uses' => 'AdminController@user_save']); Route::get('/admin/user/{id}/edit', ['as' => 'user.edit', 'uses' => 'AdminController@edit_user']); Route::get('/admin/user/{id}/ban', 'AdminController@ban_user'); /* Settings */ Route::get('/admin/settings', ['as' => 'settings', 'uses' => 'AdminController@settings']); Route::post('/admin/settings/save', ['as' => 'settings.save', 'uses' => 'AdminController@settings_save']); /* Cases */ Route::get('/admin/cases', ['as' => 'cases', 'uses' => 'AdminController@cases']); Route::get('/admin/new_case', ['as' => 'new_case', 'uses' => 'AdminController@new_case']); Route::get('/admin/case/{id}/edit', ['as' => 'case.edit', 'uses' => 'AdminController@case_edit']); Route::get('/admin/case/{id}/delete', ['as' => 'case.delete', 'uses' => 'AdminController@case_delete']); Route::get('/admin/item/{id}/add', ['as' => 'item.add', 'uses' => 'AdminController@item_add']); Route::get('/admin/item/{id}/edit', ['as' => 'item.edit', 'uses' => 'AdminController@item_edit']); Route::get('/admin/item/{id}/delete', ['as' => 'item.delete', 'uses' => 'AdminController@item_delete']); Route::post('/admin/item/add', ['as' => 'item.save', 'uses' => 'AdminController@item_create']); Route::post('/admin/item/update', ['as' => 'item.update', 'uses' => 'AdminController@item_update']); Route::post('/admin/case/save', ['as' => 'case.save', 'uses' => 'AdminController@add_case']); Route::post('/admin/case/update', ['as' => 'case.upd', 'uses' => 'AdminController@case_update']); /* Withdraw */ Route::get('/admin/withdraw', ['as' => 'withdraw', 'uses' => 'AdminController@withdraw']); Route::post('/admin/withdraw/save', ['as' => 'withdraw.save', 'uses' => 'AdminController@withdraw_save']); Route::get('/admin/withdraw/{id}/edit', ['as' => 'withdraw.edit', 'uses' => 'AdminController@edit_withdraw']); /*Payments*/ Route::get('/admin/payments', 'AdminController@payments'); /*promocodes*/ Route::get('/admin/promocodes', 'AdminController@promocodes'); Route::post('/admin/createpromo', 'AdminController@createpromo'); /*support*/ Route::get('/admin/support', 'AdminController@sup'); Route::get('/admin/support/{id}/close', 'AdminController@sup_close'); }); /*adminka*/ Route::group(['middleware' => 'auth'], function () { Route::get('/logout', 'LoginController@logout'); });
В файле .env в корне сайта который, измени эту строку: Код (Text): APP_DEBUG=false На: Код (Text): APP_DEBUG=true И обнови страницу снова должна появится ошибка по идеи. И сбрось ошибку сюда.
Код (Text): <div class="row"> <div class="col-md-12"> <form class="form-horizontal" method="POST" action="/admin/createpromo"> <input type="hidden" name="_token" value="{{ csrf_token() }}"> <div class="form-group"> <label for="amount" class="control-label col-xs-1">Сумма</label> <div class="col-xs-4"> <input type="number" class="form-control" id="amount" placeholder="Сумма" onchange="if (this.value < 1) this.value=1" name='amount' value='100'> </div> <label for="count" class="control-label col-xs-1">Количество</label> <div class="col-xs-4"> <input type="number" class="form-control" id="count" placeholder="Количество" onchange="if (this.value < 1) this.value=1" name="count" value='1'> </div> <button type="submit" class="btn btn-primary col-xs-1"><i class="fa fa-plus-circle" aria-hidden="true"></i> Создать</button> </div> </form> <div class="portlet light bordered"> <div class="portlet-body"> <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%"> <thead> <tr> <th>#</th> <th>Код</th> <th>Сумма за активацию</th> </tr> </thead> <tbody> @foreach($a as $b) <tr> <td style="vertical-align: middle;">{{$b->id}}</td> <td align="center">{{ $b->code }}</td> <td style="vertical-align: middle;">{{$b->price}}</td> </tr> @endforeach </tbody> </table> </div> </div> </div> </div> --- Добавлено --- Код (Text): public function createpromo(Request $r) { if(!isset($r->amount) || !isset($r->count)) { $r->session()->flash('alert-success', 'Не введены параметры!'); return redirect()->back(); } else { $count = $r->count; for ($i = 1; $i <= $count; $i++) { $user = Promo::create([ 'code' => $this->generate(), 'price' => $r->amount ]); } $r->session()->flash('alert-success', 'Промо-коды успешно созданы!'); return redirect()->back(); } } а это его контролер --- Добавлено --- по сути должна пойти запись в бд о создании промо кода а выдает ошибку if(!isset($r->amount) || !isset($r->count)) { $r->session()->flash('alert-success', 'Не введены параметры!'); return redirect()->back(); }
по сути должна пойти запись в бд о создании промо кода а выдает о страница работает не работает форма
Страница уже заработала, ты же выше писал, что не работает? В любом случае тебе нужно сделать как я вписал выше --- Добавлено --- Как мы узнаем что за ошибка?
выдает ошибку if(!isset($r->amount) || !isset($r->count)) { $r->session()->flash('alert-success', 'Не введены параметры!'); return redirect()->back(); } --- Добавлено --- на скрине зеленым фоном --- Добавлено ---
Перед PHP: if(!isset($r->amount) || !isset($r->count)) Напиши. PHP: dd($r->all()); и скрин скинь что отобразит