laravel

Undefined property: Illuminate\Database\Eloquent\Builder::$winner_id

十年热恋 提交于 2021-01-29 19:40:35
问题 I have a draw system on my site. There are 2 draws in the database now, but for some reason, only the last created draw is displayed on the draw page. My code is: public function raffling() { parent::setTitle('Items raffling | '); $green_ticket = \DB::table('users')->where('id', $this->user->id)->value('green_ticket'); $kolvo=\DB::table('giveaway_items')->where('status',0)->orderBy('id', 'desc')->count(); $giveaway = Giveaway::orderBy('id', 'desc')->first(); $giveaway_users = \DB::table(

How to change time zome in different tables in Laravel

时光总嘲笑我的痴心妄想 提交于 2021-01-29 19:34:34
问题 Can you give an idea? I have two tables in to postgresql DB. The are filled with recods by two separate csv files. But the records of the first csv file are with local timestamp. The second csv file is with timestamps UTC. So I need to change the time in local of the view in this table that is filled with records with timezone UTC. I used to deal with that problem before using laravel with this code in every page that I need to do that, for example: date_default_timezone_set('Europe/Sofia');

Missing required parameter for route although parameter is passed in view

筅森魡賤 提交于 2021-01-29 19:12:03
问题 I got error like this: Missing required parameters for [Route: resumenes.show] [URI: resumenes/{resumen}]. (View: .../resources/views/resumenes/index.blade.php) Controller public function index() { $resumenes = Resumene::orderBy('title','ASC')->paginate(); return view('resumenes.index', compact('resumenes') ); } public function show(Resumene $resumen) { return view('resumenes.show', [ 'resumen'=> $resumen ]); } Routes Route::get('/resumenes/{resumen}', 'ResumeneController@show')->name(

Is there a way to shorten defining v-model data, Vue.js and Laravel

徘徊边缘 提交于 2021-01-29 18:28:21
问题 On my edit page of CRUD project, I have a code that fills the form with values of which record is being edited. I use v-model to define HTML inputs, but the code seems too long. I get the data from the prop, and fill the v-model . My code that fills v-model created() { this.studentData = this.student; this.first_name = this.student.first_name; this.last_name = this.student.last_name; this.student_number = this.student.last_name; this.phone_number = this.student.phone_number; this.email = this

Can't start the laravel-websockets admin page

给你一囗甜甜゛ 提交于 2021-01-29 18:26:03
问题 I have the demo laravel websockets app up and running on a centos server, having followed the basic installation instructions here: https://github.com/beyondcode/laravel-websockets-demo I've also got it set up and running in Nginx (so am not running php artisan serve) However, I can't get the php artisan websockets:serve command to work. on the cli it says: "Starting the WebSocket server on port 6001..." And I can get into mydomain/laravel-websockets and see the admin console, but it can't

Use of undefined constant OCI_CRED_EXT - assumed 'OCI_CRED_EXT' laravel

99封情书 提交于 2021-01-29 18:21:04
问题 I'm trying to connect oracle database to my laravel application using this package: https://github.com/yajra/laravel-oci8 but having error with the external connection, this is the error: Here the line of error in package: https://github.com/yajra/laravel-oci8/blob/5.8/src/Oci8/Connectors/OracleConnector.php#L35 System details Operating System: macOS Mojave Version 10.14.4 (18E226) PHP Version: 7.3 Laravel Version: 5.8.* Laravel-OCI8 Version: 5.8.* Anyone can help me please? 回答1: Looks like

JQUERY/ AJAX Request not going through and conflicts

时光总嘲笑我的痴心妄想 提交于 2021-01-29 17:53:37
问题 I have included a contact form in my page. In the same page I have a script that gets prices depending on the value of a dropdown. Now when I try to submit the contact message I have a conflict with the script for prices. Basically it tries to run it and I have no clue why. Also the contact form when submitted never works...I just get a new page to open with URL..?message=blablabla Any idea what is going wrong? I am working on Laravel 4.2 and so the route you see redirects to my php function.

Read cookies in Laravel Blade created in JS

谁都会走 提交于 2021-01-29 17:52:17
问题 I am beginner webdeveloper. I make my project in Laravel 7 and jQuery. I create cookies in JavaScript (jQuery) and I need read it in Laravel Blade. I have this code: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var r=e.Cookies,n=e.Cookies=t();n.noConflict=function(){return e.Cookies=r,n}}())}(this,function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var r

Request::is() only work on parent route. How to use that on child route?

匆匆过客 提交于 2021-01-29 17:32:14
问题 i've tried using Request::is() for print some bootstrap class but unfortunately only work on parent route 'user', but when i using in their child not working 'user/create' Here is my code <ul class="dropdown-menu"> <li class="{{ Request::is('posts') ? 'active' : '' }}"><a class="nav-link" href="/posts">Posts</a></li> <li class="{{ Request::is('posts/create') ? 'active' : '' }}"><a class="nav-link" href="/posts/create">Create New</a></li> </ul> 回答1: u can try using (*) for any routes before or

Segments are not getting shifted / Cannot get correct arguments in Controller

↘锁芯ラ 提交于 2021-01-29 17:11:57
问题 I am trying to implement a simple localization for an existing Laravel project. Implementing Localization based on the following tutorial: https://laraveldaily.com/multi-language-routes-and-locales-with-auth/ Here is the simplified code before localization implementation: web.php Route::get('/poll/{poll_id}', 'App\Http\Controllers\PollsController@view'); PollsController@view public function view($poll_id){ echo "poll_id: ".$poll_id; } TEST URL: http://domain.name/poll/1 RESULT: poll_id: 1