laravel-5.6

Can I Test Socialite Redirect and callback

孤街浪徒 提交于 2019-12-11 06:19:50
问题 How to Test Laravel Socialite This works on laravel 5.2, but in 5.6 I dont have visit method and method get, doesnt redirect. 回答1: For Callback there is a good example at https://laracasts.com/discuss/channels/testing/testing-socialite which points to How to Test Laravel Socialite. For the redirect bit I have used the following function protected function guest_users_can_try_to_login_with_social_platform_login(string $provider) { $providerMock = \Mockery::mock('Laravel\Socialite\Contracts

Laravel error 'A facade root has not been set

折月煮酒 提交于 2019-12-11 05:14:41
问题 When I upload my laravel project to the live server, I'm getting the following error Fatal error: Uncaught RuntimeException: A facade root has not been set. in /home/reserv10/public_html/project folder/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:220 I have cleared my cache also but still it's not working on live server but the same project is working perfectly on localhost. Laravel Version: 5.6 Thanks in advance. 来源: https://stackoverflow.com/questions/53446420/laravel

Get onlyTrashed() does not exist in query builder

别说谁变了你拦得住时间么 提交于 2019-12-11 02:58:33
问题 I am trying to get trashed rows from table messages: public function trash() { return $this->onlyTrashed() ->where('user_id', '=', $this->_u) ->orWhere('receiver', '=', $this->_u) ->orderBy('deleted_at', 'desc')->get(); } I get this error: Method Illuminate\Database\Query\Builder::onlyTrashed does not exist. I checked up Builder and SoftDeletes files for onlyTrashed method and it does not exist, how can I look up to trashed messages from message table? The only way I think about is to create

Laravel return view on middleWare

自古美人都是妖i 提交于 2019-12-11 02:39:23
问题 in laravel i'm trying to check user active column and if its 0 then must be show simple view as your account is disable , after implementing below codes i get this error: my middleware: class CheckUserActive { public function handle($request, Closure $next) { if (auth()->check()) { if (auth()->user()->active == 0) { auth()->logout(); $message = 'your account is disable'; return view('layouts.frontend.pages.user-messages', compact('message')); } } return $next($request); } } kernel.php : ...

Laravel Socialite - google login failed “Missing required parameter: code”

时光怂恿深爱的人放手 提交于 2019-12-11 01:59:35
问题 I have this strange issue with using Laravel Socialite to log users in via Google API. Everything configurations seem normal and ordinary, but I keep getting error Missing required parameter: code But in localhost works fine Localhost: Server: URI de redirection autorisés http://example.com/subdir/auth/google/callback http://localhost:8000/auth/google/callback 回答1: After a long search, the solution is to remove the profile from scopes in vendor\laravel\socialite\src\Two\GoogleProvider.php

Ajax Auth redirect on Laravel 5.6

故事扮演 提交于 2019-12-11 01:18:43
问题 I have a Like button that fires an Ajax Post, this route is protected by auth:api middleware: myproject/routes/api.php Route::group(['middleware' => ['auth:api']], function () { Route::post('/v1/like', 'APIController@set_like'); }); When an authenticated user clicks the like button, no problem at all, everything works smoothly. But when guests click the button, I redirected them to login page via Javascript and after authentication they are redirected to the page specified in

Why composer does not installing laravel 5.6 propoerly?

孤人 提交于 2019-12-10 17:07:42
问题 I am unable to install Laravel 5.6 on my wamp server. I have following setup PHP Version 7.1.3 Composer Version 1.6.3 2018-01-31 When I am trying to install laravel application through composer, I am receiving following error in cmd Warning: count(): Parameter must be an array or an object that implements Counta ble in C:\Users\MyName\AppData\Roaming\Composer\vendor\symfony\process\Pipes\Windo wsPipes.php on line 221 cmd returning these errors multiple times and at the end the error following

Issue while trying to pass json of translation key-value from laravel blade to vue.js

北战南征 提交于 2019-12-10 15:32:42
问题 This is my translation file return [ "Key1" => "Message 1", "Key2" => "Message 2", "Key3" => "Message 3", "Key4" => "Message 4", "Key5" => "Message 5", "Key6" => "Message 6", "Key7" => "Message 7", "Key8" => "Message 8", ]; This is the code in Laravel Blade <profile v-bind:ErrorMessages= "{ Messages: '{!! json_encode(Lang::get('Profile')) !!}' }"> </profile> In the above component, I am trying to pass the complete translation file from laravel blade to Vue.js But, the above code print all

Inform user that message is still being typed

倖福魔咒の 提交于 2019-12-10 12:35:59
问题 I am using Laravel 5.6.7, Socket.IO and vue.js. I am not using Pusher and redis . Below is my code to send message to user chatting with me one to one. var url = "http://localhost:6001/apps/My_appId/events?auth_key=My_Key"; var socketId = Echo.socketId(); var request = { "channel": "private-Send-Message-Channel.2", "name": "MessengerEvent", "data": { "msg": message }, "socket_id": socketId }; axios.post(url, JSON.stringify(request)).then((response) => { //Message Sent }); I am trying to

Change Password in hashed function in laravel 5.6

与世无争的帅哥 提交于 2019-12-10 12:07:09
问题 I want to change my password which is been hashed while saving. How can i change the password? 'password' => Hash::make($data->password). My Controller $request->validate([ 'oldpass' => 'required', 'password' => 'required|alphaNum|min:6', 'password_confirmation' => 'required|same:newpass', ]); $id = $request->id; $users = Auth::user()->whereId($id)->get(); foreach ($users as $user) { if ($oldpass == $user->password) { $user->update([ 'password' => Hash::make($request->newpass) ]); return view