Showing posts with label hello world. Show all posts
Showing posts with label hello world. Show all posts

Wednesday, 5 March 2025

Laravel 12 Scheduling Hello world!

Many tasks require to be run every hour or day etc.  On the server this is done using a cron.

Laravel provides an easy way to create scheduled events and (importantly) how to test them before they reach the cron stage on the server.

Below is a "Hello world" example, which should offer some confidence and inspiration.

At the end of routes/console.php add the following lines:

Schedule::call(function () {

    echo "Hello World";

})->everyTwoSeconds();

Now run the command:

php artisan schedule:list

The command helpfully tells where the scheduling is going to take place.

Now let's run the task using the command:

php artisan schedule:work

After a short delay, you will see "Hello world" being outputted every 2 seconds as we stipulated.

Now you can see all sorts of options.

Monday, 4 April 2011

Hello jQuery Mobile

I've been  a bit quiet on the blog front over the last week because I've been knee deep in stuff. One of the things I've been working with is jQuery Mobile. A real solution for me. I didn't want to re-learn Java to create Android apps. I certainly didn't want to learn Objective-C for iPhone apps. I do want to use all my existing web and PHP skills to develop apps for mobile devices. jQuery Mobile suits this perfectly.

It's only really in alpha at the moment and be prepared to reconfigure everything you're done as each version changes, but it's already looking very good.

Below is my Hello World! page using jQuery Mobile.

See demo.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello jQuery Mobile</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script>
</head>
<body>
<div data-role="page">
Hello jQuery Mobile
</div>
</body>
</html>