PHP code example of zoparga / laravel-company-information

1. Go to this page and download the library: Download zoparga/laravel-company-information library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zoparga / laravel-company-information example snippets



$model = \App\Models\Model::find(1);

$model->companyInformations()->create([
    'full_name' => 'YOUR INFORMATION',
    'main_address' => 'YOUR INFORMATION',
    'bank_bic' => 'YOUR INFORMATION',
    'bank_iban' => 'YOUR INFORMATION',
    'vat' => 'YOUR INFORMATION',
]);

$companyInformationId = 1;

$model->updateCompanyInformation($companyInformationId, [
    'full_name' => 'YOUR INFORMATION',
    'main_address' => 'YOUR INFORMATION',
    'bank_bic' => 'YOUR INFORMATION',
    'bank_iban' => 'YOUR INFORMATION',
    'vat' => 'YOUR INFORMATION',
]);

Get the addresses, order by ID - desc
Or you can limit it here
$model->getLatestCompanyInformationes()->get();

Or you can limit it here
$model->getLatestCompanyInformationes()->limit(3)->get();

Of course you can get last created address
$model->getLastCompanyInformation();


bash
php artisan vendor:publish --provider="zoparga\CompanyInformation\CompanyInformationServiceProvider" --tag="company-information-migrations"
php artisan migrate
bash
php artisan vendor:publish --provider="zoparga\CompanyInformation\CompanyInformationServiceProvider" --tag="laravel-company-information-config"