I have a question about to resize an image in Laravel with intervention.io (Link: http://image.intervention.io/
My question is that I don't understand how to input in my code, can somebody help me with showing the example? Thank you in advance!
MY CODE:
account.blade.php:
@extends('layouts.master')
@section('title')
Account
@endsection
@section('content')
<section class="row new-post">
<div class="col-md-6 col-md-offset-3">
<header><h3>Your Account</h3></header>
<form action="{{ route('account.save') }}" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="first_name">First Name</label>
<input type="text" name="first_name" class="form-control" value="{{ $user->first_name }}" id="first_name">
</div>
<div class="form-group">
<label for="image">Image (only .jpg)</label>
<input type="file" name="image" class="form-control" id="image">
</div>
<button type="submit" class="btn btn-primary">Save Account</button>
<input type="hidden" value="{{ Session::token() }}" name="_token">
</form>
</div>
</section>
@if (Storage::disk('local')->has($user->first_name . '-' . $user->id . '.jpg'))
<section class="row new-post">
<div class="col-md-6 col-md-offset-3">
<img src="{{ route('account.image', ['filename' => $user->first_name . '-' . $user->id . '.jpg']) }}" alt="" class="img-responsive">
</div>
</section>
@endif
@endsection
User.php:
<?php
namespace App;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
class User extends Model implements Authenticatable
{
use \Illuminate\Auth\Authenticatable;
public function posts()
{
return $this->hasMany('App\Post');
}
public function likes()
{
return $this->hasMany('App\Like');
}
}