Laravel – ANJ WebTech https://anjwebtech.com Advancing Your Journery Fri, 05 Mar 2021 06:21:25 +0000 en-US hourly 1 https://wordpress.org/?v=5.4.15 https://anjwebtech.com/wp-content/uploads/2020/07/favicon.png Laravel – ANJ WebTech https://anjwebtech.com 32 32 Updated Laravel to 8.3 https://anjwebtech.com/updated-laravel-to-8-3/ https://anjwebtech.com/updated-laravel-to-8-3/#respond Fri, 05 Mar 2021 05:50:37 +0000 https://anjwebtech.com/?p=4874 Make Database Factory macroable

The post Updated Laravel to 8.3 appeared first on ANJ WebTech.

]]>
Make Database Factory macroable

The post Updated Laravel to 8.3 appeared first on ANJ WebTech.

]]>
https://anjwebtech.com/updated-laravel-to-8-3/feed/ 0
Php artisan command list https://anjwebtech.com/php-artisan-command-list/ https://anjwebtech.com/php-artisan-command-list/#respond Thu, 25 Feb 2021 06:19:07 +0000 https://anjwebtech.com/?p=4877 command php artisan list 1. make:controller (creates a new controller file) php artisan make:controller UserController 2. make:model (Create a new Eloquent model class) php artisan make:model Photo 3. make:migration (Create a new migration file) php artisan make:migration create_projects_table 4. make:seeder (Create a new database seeder class) php artisan make:seeder BooksTableSeeder […]

The post Php artisan command list appeared first on ANJ WebTech.

]]>
command php artisan list

1. make:controller (creates a new controller file)
php artisan make:controller UserController

2. make:model (Create a new Eloquent model class)
php artisan make:model Photo

3. make:migration (Create a new migration file)
php artisan make:migration create_projects_table

4. make:seeder (Create a new database seeder class)
php artisan make:seeder BooksTableSeeder

5. make:request (Create a new form request class in app/Http/Requests folder)
php artisan make:request StoreBlogPost

6. make:middleware (Create a new middleware class)
php artisan make:middleware CheckAge

7. make:policy (Create a new policy class)
php artisan make:policy PostPolicy

8. make:command (Create a new Artisan command)
php artisan make:command SendEmails

9. make:event (Create a new event class)
php artisan make:event OrderShipped

10. make:job (Create a new job class)
php artisan make:job SendReminderEmail

11. make:listener (Create a new event listener class)
php artisan make:listener SendShipmentNotification

12. make:mail (Create a new email class)
php artisan make:mail OrderShipped

13. make:notification (Create a new notification class)
php artisan make:notification InvoicePaid

14. make:provider (Create a new service provider class)
php artisan make:provider DuskServiceProvider

15. make:test (Create a new test class)
php artisan make:test UserTest

16. make:channel (Create a new channel class for broadcasting)
php artisan make:channel OrderChannel

17. make:exception (Create a new custom exception class)
php artisan make:exception UserNotFoundException

18. make:factory (Create a new model factory)
php artisan make:factory PostFactory –model=Post

19. make:observer (Create a new observer class)
php artisan make:observer PostObserver –model=Post

20. make:rule (Create a new validation rule)
php artisan make:rule Uppercase

21. make:resource (Create a new API resource)
php artisan make:resource PostResource

The post Php artisan command list appeared first on ANJ WebTech.

]]>
https://anjwebtech.com/php-artisan-command-list/feed/ 0
Add, Update, Delete and Read JSON Data/File in PHP https://anjwebtech.com/add-update-delete-and-read-json-data-file-in-php/ https://anjwebtech.com/add-update-delete-and-read-json-data-file-in-php/#respond Tue, 05 Jan 2021 05:41:02 +0000 https://anjwebtech.com/?p=4872 Read JSON File in PHP: <?php // load file $data = file_get_contents('results.json'); // decode json to associative array $json_arr = json_decode($data, true); foreach ($json_arr as $key => $value) { echo $json_arr[$key] . " - " . $json_arr[$value] . "<br/>"; } ?> Add to JSON File in PHP: <?php // read […]

The post Add, Update, Delete and Read JSON Data/File in PHP appeared first on ANJ WebTech.

]]>
Read JSON File in PHP:
<?php
// load file
$data = file_get_contents('results.json');

// decode json to associative array
$json_arr = json_decode($data, true);

foreach ($json_arr as $key => $value) {
    echo  $json_arr[$key] . " - " .  $json_arr[$value] . "<br/>";
}
?>

Add to JSON File in PHP:

<?php
// read json file
$data = file_get_contents('results.json');

// decode json
$json_arr = json_decode($data, true);

// add data
$json_arr[] = array('Code'=>4, 'Name'=>'Jeff Darwin', 'Sports'=>'Cricket');

// encode json and save to file
file_put_contents('results_new.json', json_encode($json_arr));
?>

Update JSON File PHP:

<?php
// read file
$data = file_get_contents('results.json');

// decode json to array
$json_arr = json_decode($data, true);

foreach ($json_arr as $key => $value) {
    if ($value['Code'] == '2') {
        $json_arr[$key]['Sports'] = "Foot Ball";
    }
}

// encode array to json and save to file
file_put_contents('results_new.json', json_encode($json_arr));
?>

Delete JSON Data from File:

<?php
// read json file
$data = file_get_contents('results.json');

// decode json to associative array
$json_arr = json_decode($data, true);

// get array index to delete
$arr_index = array();
foreach ($json_arr as $key => $value)
{
    if ($value['Code'] == "2")
    {
        $arr_index[] = $key;
    }
}

// delete data
foreach ($arr_index as $i)
{
    unset($json_arr[$i]);
}

// rebase array
$json_arr = array_values($json_arr);

// encode array to json and save to file
file_put_contents('results_new.json', json_encode($json_arr));
?>

 

The post Add, Update, Delete and Read JSON Data/File in PHP appeared first on ANJ WebTech.

]]>
https://anjwebtech.com/add-update-delete-and-read-json-data-file-in-php/feed/ 0
Benefits of Choosing Laravel Framework for Your Next Project https://anjwebtech.com/benefits-of-choosing-laravel-framework-for-your-next-project/ https://anjwebtech.com/benefits-of-choosing-laravel-framework-for-your-next-project/#respond Thu, 06 Aug 2020 10:45:13 +0000 https://anjwebtech.com/?p=4227 “Love beautiful code? We do too.” Laravel framework has taken PhP to new heights. This framework is a newbie to the IT industry, which can be quite daunting, but at the same time it has been fortunate enough in attracting a lot of users. In the more technical terms: Laravel, […]

The post Benefits of Choosing Laravel Framework for Your Next Project appeared first on ANJ WebTech.

]]>

“Love beautiful code? We do too.”

Laravel framework has taken PhP to new heights. This framework is a newbie to the IT industry, which can be quite daunting, but at the same time it has been fortunate enough in attracting a lot of users. In the more technical terms:

Laravel, a PHP framework, is an open-source toolbox that aids in developing high-end applications.

mvc diagram with routes

1. Highly Secured
2. Authorization and Authentication systems creation
3. Integration with Mail Services
4. Reduce Manual Effort & Cost
5. Tools Integration for Agile Development
6. Fixing Technical Vulnerabilities
7. Traffic Handling
8. Inbuilt Libraries
9. URL Generations
10. Artisan Tool for Command Line
11. Fine Unit Testing

Laravel is popular because:

  • Tasks that typically take hours and hundreds of lines of code to write can be performed with pre-built functions within few minutes with Laravel framework. For instance, cache (to enhance performance), authentication (social login integration) etc. are already instituted in Laravel’s new installation which makes the development easier, faster and more efficient!
  • Writing unit tests is a time – consuming task, but the effort spent is definitely worthwhile because software testing provides product or service quality information to customers. Laravel testing is, fortunately, already integrated into the framework!
  • Developers don’t have to spend too much time analyzing best practices in developing and maintaining web applications and taking decisions on how to properly implement everything because the documentation in Laravel framework is detailed. You can find various courses, code snippets, tutorials on Laravel. Unlike other frameworks, Laravel framework is pleasing and welcoming.

The post Benefits of Choosing Laravel Framework for Your Next Project appeared first on ANJ WebTech.

]]>
https://anjwebtech.com/benefits-of-choosing-laravel-framework-for-your-next-project/feed/ 0