laravel invoice toturial

Solutions on MaxInterview for laravel invoice toturial by the best coders in the world

showing results for - "laravel invoice toturial"
Naya
07 Jul 2016
1$ composer require laraveldaily/laravel-invoices
Yuna
04 Jan 2019
1use LaravelDaily\Invoices\Invoice;
2use LaravelDaily\Invoices\Classes\Buyer;
3use LaravelDaily\Invoices\Classes\InvoiceItem;
4
5<...>
6
7        $customer = new Buyer([
8            'name'          => 'John Doe',
9            'custom_fields' => [
10                'email' => 'test@example.com',
11            ],
12        ]);
13
14        $item = (new InvoiceItem())->title('Service 1')->pricePerUnit(2);
15
16        $invoice = Invoice::make()
17            ->buyer($customer)
18            ->discountByPercent(10)
19            ->taxRate(15)
20            ->shipping(1.99)
21            ->addItem($item);
22
23        return $invoice->stream();
Kallie
23 Jun 2016
1$ php artisan invoices:install
Henry
25 Jan 2021
1$ php artisan invoices:update
Dario
19 Apr 2017
1use LaravelDaily\Invoices\Invoice;
2use LaravelDaily\Invoices\Classes\Party;
3use LaravelDaily\Invoices\Classes\InvoiceItem;
4
5<...>
6
7        $client = new Party([
8            'name'          => 'Roosevelt Lloyd',
9            'phone'         => '(520) 318-9486',
10            'custom_fields' => [
11                'note'        => 'IDDQD',
12                'business id' => '365#GG',
13            ],
14        ]);
15
16        $customer = new Party([
17            'name'          => 'Ashley Medina',
18            'address'       => 'The Green Street 12',
19            'code'          => '#22663214',
20            'custom_fields' => [
21                'order number' => '> 654321 <',
22            ],
23        ]);
24
25        $items = [
26            (new InvoiceItem())->title('Service 1')->pricePerUnit(47.79)->quantity(2)->discount(10),
27            (new InvoiceItem())->title('Service 2')->pricePerUnit(71.96)->quantity(2),
28            (new InvoiceItem())->title('Service 3')->pricePerUnit(4.56),
29            (new InvoiceItem())->title('Service 4')->pricePerUnit(87.51)->quantity(7)->discount(4)->units('kg'),
30            (new InvoiceItem())->title('Service 5')->pricePerUnit(71.09)->quantity(7)->discountByPercent(9),
31            (new InvoiceItem())->title('Service 6')->pricePerUnit(76.32)->quantity(9),
32            (new InvoiceItem())->title('Service 7')->pricePerUnit(58.18)->quantity(3)->discount(3),
33            (new InvoiceItem())->title('Service 8')->pricePerUnit(42.99)->quantity(4)->discountByPercent(3),
34            (new InvoiceItem())->title('Service 9')->pricePerUnit(33.24)->quantity(6)->units('m2'),
35            (new InvoiceItem())->title('Service 11')->pricePerUnit(97.45)->quantity(2),
36            (new InvoiceItem())->title('Service 12')->pricePerUnit(92.82),
37            (new InvoiceItem())->title('Service 13')->pricePerUnit(12.98),
38            (new InvoiceItem())->title('Service 14')->pricePerUnit(160)->units('hours'),
39            (new InvoiceItem())->title('Service 15')->pricePerUnit(62.21)->discountByPercent(5),
40            (new InvoiceItem())->title('Service 16')->pricePerUnit(2.80),
41            (new InvoiceItem())->title('Service 17')->pricePerUnit(56.21),
42            (new InvoiceItem())->title('Service 18')->pricePerUnit(66.81)->discountByPercent(8),
43            (new InvoiceItem())->title('Service 19')->pricePerUnit(76.37),
44            (new InvoiceItem())->title('Service 20')->pricePerUnit(55.80),
45        ];
46
47        $notes = [
48            'your multiline',
49            'additional notes',
50            'in regards of delivery or something else',
51        ];
52        $notes = implode("<br>", $notes);
53
54        $invoice = Invoice::make('receipt')
55            ->series('BIG')
56            ->sequence(667)
57            ->serialNumberFormat('{SEQUENCE}/{SERIES}')
58            ->seller($client)
59            ->buyer($customer)
60            ->date(now()->subWeeks(3))
61            ->dateFormat('m/d/Y')
62            ->payUntilDays(14)
63            ->currencySymbol('$')
64            ->currencyCode('USD')
65            ->currencyFormat('{SYMBOL}{VALUE}')
66            ->currencyThousandsSeparator('.')
67            ->currencyDecimalPoint(',')
68            ->filename($client->name . ' ' . $customer->name)
69            ->addItems($items)
70            ->notes($notes)
71            ->logo(public_path('vendor/invoices/sample-logo.png'))
72            // You can additionally save generated invoice to configured disk
73            ->save('public');
74            
75        $link = $invoice->url();
76        // Then send email to party with link
77
78        // And return invoice itself to browser or have a different view
79        return $invoice->stream();