Skip to content
Advertisement

Tag: laravel-5.3

laravel observers are not working

I am trying to listen to model events using laravel observers .The problem is when i submit my form (update or creating new records), nothing happened at all .Do i miss something ? app.php CasesManagerServiceProvider.php CasesObserver.php Cases.php Answer Ok i have found my answer . All the problem was when I added use appObserversCasesObserver; in CasesManagerServiceProvider.php instead of use AppObserversCasesObserver;

How to compress image before uploading in Laravel?

I’m making a images gallery website where users can upload any image and they will be displayed on frontend. I need to compress images without effecting it’s quality to reduce there size so that page load speed should not effect that much. I’m using following code to upload image: Answer You need to optimize the image for web usage as

Laravel: HTML in notification

I’m using the default notification system (Laravel 5.3) to send an email. I want to add HTML tags in message. This does not work (it displays the strong tags in plain text): I know it’s normal because text is displayed in {{ $text }} in the mail notification template. I tried to use the same system as in csrf_field() helper:

How do i pass csrf token with this file upload

I have this html: And this jquery plugin to upload file: And the route under web middleware group: And whenever i try to upload the file i got the familiar error: TokenMismatchException in VerifyCsrfToken.php Answer First add this code on your form <input type=”hidden” id=”csrf_token” name=”_token” value=”{{ csrf_token() }}”> this adds a csrf token field on your form using laravel’s

Why css and bootstrap is not loading in Laravel 5.3?

This is my route file… Route::group([‘middleware’ => [‘auth’]], function(){ Route::get(‘/profile/{username}’, ‘ProfileControllers@getProfile’); }); The “ProfileControllers” is this… namespace AppHttpControllers; use DB; use AppUser; use IlluminateHttpRequest; class ProfileControllers extends Controller { public function getProfile($username) { $user = DB::table(‘users’)->where(‘username’,’=’, $username)->get(); return view(‘web.profile’); } } And this is the view file… @extends(‘layout’) @section(‘content’) This is your profile @stop And The head of the Layout

Advertisement