laravel-5.3

Why the deleted data still appear in the interface?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 09:54:19
问题 Look here : When I click button delete, data deleted still appear in the interface. I look at the table in the database, the data is erased. Data can be lost if I run this: php artisan cache:clear on git bash. How without running the command, data can be erased? UPDATE My controller is like this : public function deleteAccount(Request $request) { $id_account = $request->input('id_account'); try{ if($this->user_service->deleteAccount($id_account)) { $status='success'; }else { $status = 'failed

Laravel 5.3 - Issue displaying Images from public folder using @extends & @sections

偶尔善良 提交于 2019-11-30 09:47:14
问题 2nd Update: For some reason the display: table; in my .header_table within home.blade.php was preventing the image from rendering. UPDATE: I should have mentioned that I am trying to display an image within a @section ( i like to call them partials) . When I went to my main.blade.php and did the {{ Html::image('images/max.jpg') }} link it displayed my image with no issue. My questions now: How do I display an image within a @section (partial)? project_name/public/images/max.jpg - path

How to change storage path in laravel 5.3 to public?

非 Y 不嫁゛ 提交于 2019-11-30 08:52:25
In laravel 5.3 , if I upload a file from a form, it will be stored in own storage directory. Then I should create a symlink to that storage path in public path. I can't use creating symlinks on my system because of the limitation. How can I upload files directly to public/uploads instead of storage/app/uploads ? I tried to set the path in AppServiceProvider.php but it doesn't work. public function register() { //not working: $this->app->useStoragePath( $this->app->basePath() . "/upload"); //also not working: // $this->app->bind('path.storage', function () { // return $this->app->basePath() . '

laravel errno 150 foreign key constraint is incorrectly formed

[亡魂溺海] 提交于 2019-11-30 07:01:51
Can anybody help me to solve this problem? There are 3 tables with 2 foreign keys: Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('email')->unique(); $table->string('password'); $table->rememberToken(); $table->timestamps(); }); Schema::create('firms', function (Blueprint $table) { $table->increments('id'); $table->string('title')->nullable(); $table->integer('user_id')->unsigned()->nullable(); $table->foreign('user_id')->references('id')->on('users'); $table->timestamps(); }); Schema::create('jobs', function (Blueprint

How to change reset password email subject in laravel?

喜夏-厌秋 提交于 2019-11-30 06:23:27
问题 I am beginner in Laravel. Currently I am learning this framework. My curent Laravel version is 5.3. I am scaffolding my auth by using php artisan make:auth All are working fine. Also I configured gmail smtp in my .env file and mail.php in config directgory. All are perfectly working. But I saw by-default the forgot password email subject is going Reset Password . I want to change that. I saw some blog. I found some blog. I have implement that in my site. But same output coming. I followed

Laravel 5.3 - Single Notification for User Collection (followers)

大憨熊 提交于 2019-11-30 03:05:19
When I have a single notifiable user, a single entry in the notifications table is inserted, along with a mail / sms sent which is perfectly working via channels. The issue is when I have a user collection, a list of 1k users following me, and I post an update. Here is what happens when using the Notifiable trait as suggested for multi-user case: 1k mails / sms sent (issue is not here) 1k notification entries added to the DB's notifications table It seems that adding 1k notifications to the DB's notifications table is not an optimal solution. Since the toArray data is the same, and everything

Laravel 5.3 - How to log all queries on a page?

前提是你 提交于 2019-11-30 01:54:29
My team and I are working on a rather big project. There's queries going on everywhere - in controllers, in view composers in views (lazy loading) and probably in some other services as well. It's getting hard to keep a track of it all and the page load speed is fairly slow at the moment. Where would I put \DB::enableQueryLog() and \DB::getQueryLog() to log ALL the queries and dump them? Basically I'm looking for some place in code that happens before any of the queries happen (to put enableQueryLog()) and I'm looking for a place that happens after the views render (to dump getQueryLog()).

Laravel 5.3 Passport JWT Authentication

℡╲_俬逩灬. 提交于 2019-11-29 21:02:12
Earlier when I was using laravel 5.2, i used a third party package https://github.com/tymondesigns/jwt-auth/ for making JWT based authentication. Where we just had to pass the username and password to get a token. Now in laravel 5.3 with the introduction of passport I want to make a JWT based authentication but passport requires me to specify the client_id and client_secret along with the username and password. which was not there in tymondesigns/jwt-auth. If I make a request without the client_id then it throws an error http://pix.toile-libre.org/upload/original/1482908288.png but when I pass

How to set and get Cookie in laravel

无人久伴 提交于 2019-11-29 20:58:51
问题 I would like to set and get value in cookie but it doesn't work: Cookie::queue('online_payment_id', "1", 15); $value = Cookie::get('online_payment_id'); dd($value); dd() returns null ; I used below way but I got this message: Method cookie does not exist. request()->cookie('online_payment_id'); $value = response()->cookie('online_payment_id', "1", 15); dd($value); 回答1: Set Cookies public function setCookie(Request $request){ $minutes = 60; $response = new Response('Set Cookie'); $response-

How can I update pivot table on laravel?

被刻印的时光 ゝ 提交于 2019-11-29 18:10:34
I use laravel 5.3 I have 3 table : table product, table category and table products_categories table product : id, name, etc table category : id, name, etc table products_categories : id, product_id, category_id In model product, I have method this : public function categories() { return $this->belongsToMany(Category::class, 'products_categories', 'product_id', 'category_id') ->withPivot('id') ->withTimestamps(); } So 1 product have many category My code like this For example $param['category'] like this : Array ( ['category1'] => 4 ['category2'] => 11 ['category3'] => 18 ) $product_id = 1