Fix Class UsersTableSeeder does not exist (Laravel)

the seeder UsersTableSeeder does exist but -> php artisan db:seed say it doesn’t exist

just type this on command line

project-folder $ composer dump-autoload



Manual pagination with Laravel 5.*

manual paginate with laravel

use Illuminate\Pagination\Paginator;
use Illuminate\Pagination\LengthAwarePaginator;

$array = [12,23,34,45];
$page = Input::get('page', 1); // Get the current page or default to 1, this is what you miss!
$perPage = 20;
$offset = ($page * $perPage) - $perPage;

return new LengthAwarePaginator(array_slice($array, $offset, $perPage, true), count($array), $perPage, $page, ['path' => $request->url(), 'query' => $request->query()]);



Send Email (With Generate PDF Attachment) – Laravel

first make notification (php artisan make:notification YourNotification)

public function toMail($notifiable)
$invoice = $this->invoice;
$pdf = PDF::loadview('subscribe.invoices.pdf-invoice-detail', compact('invoice'));

return (new MailMessage)
->subject(' - Invoice #'. $this->invoice->id)
->line('Your invoice has been release.')
->action('Check Invoice', route('view.invoices') . '?id='. $this->invoice->id)
->line('Make sure you pay the invoice, Check You Email Attachment!')
->attachData($pdf->output(), Auth::user()->id_user . '_' . $invoice->id . '.pdf', [
'mime' => 'application/pdf',