laravel-5.5

Laravel : Join within query using Eloquent

不想你离开。 提交于 2020-01-25 03:50:11
问题 I have a five tables in which i need to get data from all this. post,product,categories,attributes,post_attribute I have a query in my model that collect all post for a one product and it contains categories and attributes details . Query : Post::with(['product.categories.attributes'])->whereStatus("Active")->get(); Response: "PostDetails": [ { "id": 153, "user_id": 3, "product_id": 1, "demand_or_supply": "Demand", "description": "This is a post description three", "image_one": null, "image

Laravel 5.5. Missing required parameters for [Route: password.request]

走远了吗. 提交于 2020-01-24 17:41:05
问题 I have the following in my route : Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request'); My reset.blade under auth is looks like <div class="container"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading">Reset Password</div> <div class="panel-body"> <form class="form-horizontal" method="POST" action="{{ route('password.request') }}"> {{ csrf_field() }} <input type="hidden

Laravel 5.5 - mail not working with `mail` driver

拜拜、爱过 提交于 2020-01-24 10:14:11
问题 Ob my Laravel setup, mail was always working until I upgraded the framework to 5.5 (from 5.4). Now it always fail at the following: Do note the following: mail server on local env = http://www.toolheap.com/test-mail-server-tool/users-manual.html ive used this like since 5yrs (this is a one-click-install/no-dramas/no-config/no-error test mail server) and till yesterday it worked so im NOT changing it to something else The php's mail() function works if called directly The mail driver ive set

Is there any callback for on leave, on join , on typing in vue.js?

孤人 提交于 2020-01-24 05:28:12
问题 About I am learning Vue.js with Laravel. Presently, practicing on sending real time text messages between 2 users. Below code sends message to another user 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) => { //Success callback } ); Receive

How to solve Exception It is unsafe to run Dusk in production in laravel 5.5?

南笙酒味 提交于 2020-01-22 14:38:26
问题 I upgrated my project from laravel 5.4 to laravel 5.5 , I dont have any problem in local env but in server i get this exception , I searched a lot and i know this issue may be duplicated but no solutions solved my problem! How can i not registering dusk when environment is production? i wrote this code in AppServiceProvider.php : public function register() { // Dusk, if env is appropriate if ($this->app->environment('local', 'testing')) { $this->app->register(DuskServiceProvider::class); } }

Flattening data with same performance for recursive $query->with

痴心易碎 提交于 2020-01-16 10:09:10
问题 I am using Laravel 5.5.13. Thanks to awesome help from awesome member of SO I currently get nested (and repeated) data by doing this: public function show(Entity $entity) { return $entity->with([ 'comments' => function($query) { $query->with([ 'displayname', 'helpfuls' => function($query) { $query->with('displayname'); } ]); }, 'thumbs' => function($query) { $query->with('displayname'); } ])->firstOrFail(); } This gives me example data like this: https://gist.githubusercontent.com/blagoh

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message Laravel 5.5

只谈情不闲聊 提交于 2020-01-13 09:01:50
问题 This is doing my head in. I'm getting this error when trying to login from a form: Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message LoginController.php <?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class LoginController extends Controller { use AuthenticatesUsers; protected $username = 'username'; protected

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message Laravel 5.5

廉价感情. 提交于 2020-01-13 09:01:29
问题 This is doing my head in. I'm getting this error when trying to login from a form: Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message LoginController.php <?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class LoginController extends Controller { use AuthenticatesUsers; protected $username = 'username'; protected

Laravel : How to add particular array store in session

我是研究僧i 提交于 2020-01-05 08:00:15
问题 I am little confused about session as i am new to in laravel. On my laravel app there is a lists of activity, every activity has it's details. When i click on activity button(button name: interesed?) activity id add on session, If i add another activity it is also add on session. I need functionality to add and remove inquiry id from session & on last i want all added activity id. Note: I am doing using ajax. What i have done sharing here. Here is a view of my lists inquiry On my web.php

How to make assertions on a Laravel Mailable

馋奶兔 提交于 2020-01-05 05:09:27
问题 In a test I would like to make some assertions on a Mailable using Mail::assertSent() , like this: Mail::assertSent(MyMailable::class, function ($mail) use ($user) { return $mail->hasTo($user->email); }); So far, I have found the hasTo() , hasFrom() , hasBcc() and all the other has*() methods work just great. However, when asserting a particular attribute on the Mailable exists, for example subject the attribute shows up as null and the assertion fails: Mail::assertSent(MyMailable::class,