I need to set a dynamic range/offset formula in order to track only the last 5 inputs in to separate fields (for each person). Each month I am adding 1 new row for each person (2 new rows in total), so the range of the last 5 inputs should be updated.
21 October, 2023
20 October, 2023
Outlook Showing in Process even after closing - C#
Programing Coderfunda
October 20, 2023
No comments
I am writing a code to such that I will get a trigger when ever outlook opens
Process[] processlist = System.Diagnostics.Process.GetProcessesByName("OUTLOOK");
if (processlist.Count() > 0)
{
MessageBox.Show("Outlook Opened");
}
Works great for the first time when I open outlook, but the message box continue to show even after outlook is closed .
I also checked the background process there is no outlook process running.
Help appreciated :) .
Process[] processlist = System.Diagnostics.Process.GetProcessesByName("OUTLOOK");
if (processlist.Count() > 0)
{
MessageBox.Show("Outlook Opened");
}
Works great for the first time when I open outlook, but the message box continue to show even after outlook is closed .
I also checked the background process there is no outlook process running.
Help appreciated :) .
19 October, 2023
Conditionally Assert Throwing An Exception in Pest
Programing Coderfunda
October 19, 2023
No comments
---
Pest recently added the throwsUnless() method in Pest v2.24 to conditionally verify an exception if a given boolean expression evaluates to false.
This method is the counterpart to the throwIf() method, which conditionally verifies an exception if a given expression is true:
test('example 1', function () {
// Test that only throws an exception for the mysql driver...
})->throwsIf(DB::getDriverName() === 'mysql', Exception::class, 'MySQL is not supported.');
test('example 2', function () {
// Test that throws unless the db driver is mysql...
})->throwsUnless(DB::getDriverName() === 'mysql', SomeDBException::class);
For example, let's say that you have a PHP package that supports various PHP extensions for manipulating images. Your CI environment might support and test both gd and imagemagick; however, other environments might only support one or the other:
test('gd wrapper can create an image', function () {
$image = imagecreate(width: 200, height: 200);
imagecolorallocate($image, 255, 255, 255);
imagepng($image, '/tmp/new_image_gd.png');
expect(file_exists('/tmp/new_image_gd.png'))->toBeTrue();
})->throwsUnless(extension_loaded('gd'), \Error::class);
test('imagemagic wrapper can create an image', function () {
$image = new Imagick();
// ...
})->throwsUnless(extension_loaded('imagick'), \Error::class);
The throwsIf() and throwsUnless() methods also support callables if you prefer that style or have some custom logic that you want to use to determine if the test should throw an exception:
test('example test with callables', function () {
$image = new Imagick();
// ...
})->throwsUnless(fn () => class_exists(\Imagick::class), 'Class "Imagick" not found');
Learn More
You can learn about handling Exceptions in tests in the Pest Exceptions documentation. Also, if you're new to PestPHP and prefer videos, we recommend checking out Learn PestPHP From Scratch by Luke Downing.
The post Conditionally Assert Throwing An Exception in Pest appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
Pest recently added the throwsUnless() method in Pest v2.24 to conditionally verify an exception if a given boolean expression evaluates to false.
This method is the counterpart to the throwIf() method, which conditionally verifies an exception if a given expression is true:
test('example 1', function () {
// Test that only throws an exception for the mysql driver...
})->throwsIf(DB::getDriverName() === 'mysql', Exception::class, 'MySQL is not supported.');
test('example 2', function () {
// Test that throws unless the db driver is mysql...
})->throwsUnless(DB::getDriverName() === 'mysql', SomeDBException::class);
For example, let's say that you have a PHP package that supports various PHP extensions for manipulating images. Your CI environment might support and test both gd and imagemagick; however, other environments might only support one or the other:
test('gd wrapper can create an image', function () {
$image = imagecreate(width: 200, height: 200);
imagecolorallocate($image, 255, 255, 255);
imagepng($image, '/tmp/new_image_gd.png');
expect(file_exists('/tmp/new_image_gd.png'))->toBeTrue();
})->throwsUnless(extension_loaded('gd'), \Error::class);
test('imagemagic wrapper can create an image', function () {
$image = new Imagick();
// ...
})->throwsUnless(extension_loaded('imagick'), \Error::class);
The throwsIf() and throwsUnless() methods also support callables if you prefer that style or have some custom logic that you want to use to determine if the test should throw an exception:
test('example test with callables', function () {
$image = new Imagick();
// ...
})->throwsUnless(fn () => class_exists(\Imagick::class), 'Class "Imagick" not found');
Learn More
You can learn about handling Exceptions in tests in the Pest Exceptions documentation. Also, if you're new to PestPHP and prefer videos, we recommend checking out Learn PestPHP From Scratch by Luke Downing.
The post Conditionally Assert Throwing An Exception in Pest appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
18 October, 2023
Write Single Page Applications using Laravel Splade
Programing Coderfunda
October 18, 2023
No comments
---
Laravel Splade, created by by Pascal Baljet, is a super easy way to build single-page applications (SPA) using Laravel Blade templates. Splade makes it easy to create modern, dynamic web applications that are a joy to use.
Splade provides useful Blade components that are enhanced with renderless Vue 3 components out of the box, such as the Component component. It provides that SPA-like feeling, but you can use Blade, sprinkled with interactive Vue components when required.
As you can see, in the default installation, the components fetch the page data via XHR and provide that SPA snappy feel without full page reloads.
You can use both Blade and Vue markup. Here's an example from Splade's component. Note the v-show directive and @click listener from Vue, and the Blade-specific component and variable usage {{ }}:
{{ $blog->full_content }}
{{ $blog->excerpt }}
Expand
If you need Custom Vue components, Splade has your back, and you can even utilize Server Side Rendering (SSR) to improve performance in your application.
If you also want to use Laravel Breeze or Laravel Jetstream, Splade provides starter kits for both. Splade also provides useful components out of the box you can use to get started quickly, with or without using the starter kits:
* Forms
* Links
* Events
* Flash
* Modals
* Table
* Teleport
* Toggle
* Transition
* And more!
You can get started with Splade quickly by checking out the homepage and accompanying documentation on splade.dev. You can also dive deeper and learn How Splade works under the hood.
The post Write Single Page Applications using Laravel Splade appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
Laravel Splade, created by by Pascal Baljet, is a super easy way to build single-page applications (SPA) using Laravel Blade templates. Splade makes it easy to create modern, dynamic web applications that are a joy to use.
Splade provides useful Blade components that are enhanced with renderless Vue 3 components out of the box, such as the Component component. It provides that SPA-like feeling, but you can use Blade, sprinkled with interactive Vue components when required.
As you can see, in the default installation, the components fetch the page data via XHR and provide that SPA snappy feel without full page reloads.
You can use both Blade and Vue markup. Here's an example from Splade's component. Note the v-show directive and @click listener from Vue, and the Blade-specific component and variable usage {{ }}:
{{ $blog->full_content }}
{{ $blog->excerpt }}
Expand
If you need Custom Vue components, Splade has your back, and you can even utilize Server Side Rendering (SSR) to improve performance in your application.
If you also want to use Laravel Breeze or Laravel Jetstream, Splade provides starter kits for both. Splade also provides useful components out of the box you can use to get started quickly, with or without using the starter kits:
* Forms
* Links
* Events
* Flash
* Modals
* Table
* Teleport
* Toggle
* Transition
* And more!
You can get started with Splade quickly by checking out the homepage and accompanying documentation on splade.dev. You can also dive deeper and learn How Splade works under the hood.
The post Write Single Page Applications using Laravel Splade appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
17 October, 2023
Inertia and React or Vue
Programing Coderfunda
October 17, 2023
No comments
Hi just checking your thoughts on whether to learn React or Vue, I want to learn React as it may be better to find work and it has a larger ecosystem but my issue is is there are not a lot of tuts for Laravel and React with Inertia, do you have any recomendations for tuts? Also, what are your guys thoughts on Vue vs React with Laravel?
Here is the Reddit post I read that says they are finding it hard to get jobs with Vue.
https://www.reddit.com/r/vuejs/comments/12zevaz/vue_seniors_how_do_you_feel_about_not_picking/ submitted by /u/Blissling
[link] [comments]
Here is the Reddit post I read that says they are finding it hard to get jobs with Vue.
https://www.reddit.com/r/vuejs/comments/12zevaz/vue_seniors_how_do_you_feel_about_not_picking/ submitted by /u/Blissling
[link] [comments]
16 October, 2023
Weekly /r/Laravel Help Thread
Programing Coderfunda
October 16, 2023
No comments
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
* What steps have you taken so far?
* What have you tried from the documentation?
* Did you provide any error messages you are getting?
* Are you able to provide instructions to replicate the issue?
* Did you provide a code example?
* Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the /r/Laravel community! submitted by /u/AutoModerator
[link] [comments]
* What steps have you taken so far?
* What have you tried from the documentation?
* Did you provide any error messages you are getting?
* Are you able to provide instructions to replicate the issue?
* Did you provide a code example?
* Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the /r/Laravel community! submitted by /u/AutoModerator
[link] [comments]
15 October, 2023
Laravel 9 Upgrade: Write Operations Now Overwrite Existing Files
Programing Coderfunda
October 15, 2023
No comments
Per the v9 upgrade guide, "write operations such as put, write, and writeStream now overwrite existing files by default."
I'm not exactly sure what "overwriting existing files" means in this context. From what I've observed, Storage::put() operates the same way on both Laravel 8 and 9. That is, if the file exists, then put() replaces that file's contents with what's passed into the $contents argument -- it doesn't append the contents to the file, nor does it delete the original file and create a new one (it modifies the original file).
I'm trying to upgrade our Laravel 8 app to version 9, and this is the last item on the checklist that I have to get through. I was stumped because I'm not noticing any difference in the behavior of Storage::put() between v8 and v9.
Can anyone provide any context, insight, or example to demonstrate? submitted by /u/mattk1017
[link] [comments]
I'm not exactly sure what "overwriting existing files" means in this context. From what I've observed, Storage::put() operates the same way on both Laravel 8 and 9. That is, if the file exists, then put() replaces that file's contents with what's passed into the $contents argument -- it doesn't append the contents to the file, nor does it delete the original file and create a new one (it modifies the original file).
I'm trying to upgrade our Laravel 8 app to version 9, and this is the last item on the checklist that I have to get through. I was stumped because I'm not noticing any difference in the behavior of Storage::put() between v8 and v9.
Can anyone provide any context, insight, or example to demonstrate? submitted by /u/mattk1017
[link] [comments]

