PHP code example of macsidigital / laravel-eloquent-extended
1. Go to this page and download the library: Download macsidigital/laravel-eloquent-extended 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/ */
macsidigital / laravel-eloquent-extended example snippets
php
$test = new model;
$test->test_field = 'something';
echo $test->test_field;
php
$test = new model;
$test->test_content_field = 'something';
echo $test->test_content_field;
php
$test = new model;
$test->test_content_field = 'something';
$test->setContentLanguage('de');
$test->test_content_field = 'something DE';
$test->setContentLanguage('en');
echo $test->test_content_field; // 'something'
$test->setContentLanguage('de');
echo $test->test_content_field; // 'something DE'
php
$test = new model;
$test->uri = 'something';
echo $test->uri; //esomething
php
$test = new model;
$test->createSlug('Test Something');
echo $test->uri; //test-something
$test = new model;
$test->createSlug('Test Something');
echo $test->uri; //test-something-h58s
php
$test = new model;
$test->uri = 'something';
$test->setLanguage('de');
$test->uri = 'something-de';
$test->setMetaLanguage('en');
echo $test->uri; // 'something'
$test->setMetaLanguage('de');
echo $test->uri; // 'something-de'
php
$test = new model;
$test->createSlug('something');
$model = model::withSlug('something')->first()
echo $model->uri; // 'something'
php
$test = new model;
$test->createSlug('something');
$test = new model;
$test->createSlug('something-1234');
$model = model::withoutSlug('something')->first()
echo $model->uri; // 'something-1234'