Skip to content

Instantly share code, notes, and snippets.

View pbelyaev's full-sized avatar
🧑‍💻
👍

Pavel Beliaev pbelyaev

🧑‍💻
👍
View GitHub Profile
@pbelyaev
pbelyaev / SlackNotification.php
Last active September 5, 2017 15:11
Eloquent notifiable model that can send notifications to Slack (without any attachment to a model)
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Notifications\Notification;
class SlackNotification extends Model
{
@pbelyaev
pbelyaev / default.blade.php
Last active March 31, 2017 20:51
Laravel 5.3 - Pagination with custom URLs
// resources/views/pagination/default.blade.php
<ul class="pagination">
<!-- Previous Page Link -->
@if ($paginator->onFirstPage())
<li class="page-item disabled"><span class="page-link">&laquo;</span></li>
@else
<li class="page-item"><a class="page-link" href="{{ route($__env->yieldContent('route'), [ 'page' => $paginator->currentPage() - 1 ]) }}" rel="prev">&laquo;</a></li>
@endif
<!-- Pagination Elements -->
@foreach ($elements as $element)
@pbelyaev
pbelyaev / SocialiteCallbackMiddleware.php
Last active August 26, 2022 23:32
Laravel 5.2 Socialite Middleware Example
<?php
namespace App\Http\Middleware;
use Closure;
use Laravel\Socialite\Facades\Socialite;
class SocialiteCallbackMiddleware
{