Laravel 7 Blade X

Submitted by haruncpi - 3 months ago

Blade X is cool features in Laravel 7. To know more feature in Laravel 7 visit: http://bit.ly/laravel7

// define a classless blade component

@php($user = $user ?? Auth::user())
@php($size = $size ?? 50)

<img
    class="inline-block rounded-full"
    src="{{ $user->gravatarUrl($size) }}"
    width="{{ $size }}"
    height="{{ $size }}"
/>

// ues it on your view
<x-avatar/>
<x-avatar size="20" />
<x-avatar size="60" />

// http://bit.ly/laravel7