Total Pageviews

Friday, 1 November 2024

laravel-serve-livereload

 Laravel live reload implements into `artisan serve` command with live reloading websockets.

Laravel Serve LiveReload

This package is daed, please use the new Vite integrated instead

This package integrates into default artisan serve command an WebSockets server for live reloading the application when any file changed. How it works, checkout my blog post for explaination if you don't like digging into source code.


Installation

For laravel 8, please use version ^1.x, and below use version 0.x

composer require bangnokia/laravel-serve-livereload --dev

Usage

Open terminal and run php artisan serve

This package works even when you use custom vhost such as valet or laragon

Configuration

By default, this package looking for files changes in these directories:

/app
/public 
/config 
/routes 
/resources

If you want to customize the watched forlders, you can publish the configuration file by this commmand:

php artisan vendor:publish --provider="BangNokia\ServeLiveReload\CommandServiceProvider"

and then you can config what you want in the config/serve_livereload.php.


from bangnokia/laravel-serve-livereload: Laravel live reload implements into `artisan serve` command with live reloading websockets

psycho


how to use

php index.php --target=$targetPath --code=$phpCode

$targetPath: path to the php project

$phpCode: base64_encode value of code. Example base64_encode('echo "hello"').

projects driver supported

  • Laravel
  • Wordpress
  • Plan project (which require only vendor/autoload.php)

build phar file

composer run build


from bangnokia/psycho

PHP-Http-proxy

 from bangnokia/php-http-proxy

This is for my personal use, pull request is not welcome。

Install

composer install

Usage

php start.php start

If you want to run as background daemon

php start.php start -d

If you want to stop

php start.php stop

Check status

php start.php status

If you want to set username and password, please remember alway put -u and -p before start:

php start.php -u bangnokia -p 123456 start -d





blademail

 Local SMTP desktop app for debugging and previewing your emails.

blademail.app

https://github.com/bangnokia/blademail/releases/download/v1.0.9/Blade.Mail_1.0.9_x64_en-US.msi or:

https://github.com/bangnokia/blademail/releases/download/v1.0.9/Blade.Mail_1.0.9_x64-setup.exe

from https://github.com/bangnokia/blademail

Lunar

An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

lunarphp.io

Lunar is a set of Laravel packages that bring functionality akin to Shopify and other e-commerce platforms to Laravel. You have complete freedom to create your own storefront(s), but we've already done the hard work for you in the backend.

This repository serves as a monorepo for the main packages that make up Lunar.

Requirements

  • PHP >= 8.2
  • Laravel 10 / Laravel 11
  • MySQL 8.0+ / PostgreSQL 9.2+

Documentation

Packages in this monorepo

Admin panel

The admin panel is provided to enable you to manage your store via a modern interface. You can manage all aspects of your store including products, orders, staff members etc. It's built using Filament and can be extended to meet each of your stores requirements.

Core

The core Lunar package, this provides all the things needed for your store to function. This is where all the models, actions and utilities live and is required by the admin hub.


from 

lunarphp/lunar: An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

基于php的静态博客程序lina

 static blog generator written in PHP with the powerful of Laravel blade template engine. 

lina.daudau.cc

Lina - lightweight and blazing fast static blog generator

Lina is an opinionated flat-file CMS for who want a simple and fast blog. Lina uses Blade template engine, so you can use all Blade features.

Features

  • Blazing fast: Lina is a lightweight and superfast static blog generator.
  • Written in PHP: so if you hate Javascript, Lina is for you.
  • Blade template engine: you can use all Blade features.'
  • Minimalistic: Lina is a static blog generator. It's not a full-fledged CMS.
  • Deploy everywhere! You know, just html files 🤣

Requirements

  • PHP 8.3

Getting started

There are some ways to install Lina:

Require Lina as dependency, with this option, you can keep lina up-to-date easily.

mkdir my-blog && cd my-blog && composer init --name=linaphp/blog --no-interaction --require=bangnokia/lina:^0.5 && composer install
./vendor/bin/lina new . # scaffolding a new blog skeleton in the current directory
./vendor/bin/lina serve # start a development server and happy writing

Or install Lina as global composer package

composer global require linaphp/lina
lina new my-blog
lina serve

Or you can use the phar file

curl -LO https://github.com/linaphp/lina/releases/latest/download/lina.phar && chmod +x lina.phar

Folder structure

In case you want to migrate from another blog platform, you can check the base structure of Lina

content/
    posts/
        2020-11-01-hello.md
    index.md
resources/
    views/
        index.blade.php
        post.blade.php
public/ 
    images/
    style.css
  • content directory is where you store your markdown content file.
  • resources/views directory is where you store your blade template.
  • public directory is where you store your assets like images, css, ... This folder is also where all the generated files are stored. So please remember to add your custom files to .gitignore if you want to store them in git

We really recommend you to prefix your content file with the date, so it will easy to sort and find your content. Lina automatically strip the date from the slug, so you don't need to worry about the url.

Helper functions

There are some functions that you can use to programmatically access your content.

Get all content in a directory

Get all the content in a directory. The content will be sorted by the date in the filename.

foreach (lina()->index('post') as $post) {
    echo $post->title;
}

Get a single content

$post = lina()->get('posts/2020-11-01-hello.md');

Deployments

Lina can be deployed to any static hosting provider. Here are some examples: Github pages, Netlify, Vercel, Cloudflare pages, ...

Deploy on Github pages

So you please modify the file .github/workflows/deploy.yml to match your demand.

Deploy on Cloudflare pages

We also provide a configuration file for Cloudflare pages. You can find it in cloudflare-page.sh. You can modify it to match your demand. Also you need to change the Build configuration like this. Cloudflare deploy

Built with Lina

So, you know, at least that's me.

from https://github.com/linaphp/lina

-----

Why write lina?

 The thing is, I have a lot of free time these days, I'm thinking of writing something random. Of course, just simple things like markdown are enough, no need to setup wordpress or anything. I also looked at Jekyll, this guy generates content into static html files and can be used with github pages, so convenient . Reading the doc, I see that it uses liquid template and is built with ruby. I don't know ruby, and I find it difficult to read using this liquid template engine, and it's probably not as good as laravel's blade template engine, so I also searched through some guys but found that there were many functions that I didn't need. So I built my own for ease of use. Initial idea {#idea} After consulting jekyll -> this is also why I named it pekyll (jekyll in php) , I think these functions are enough: parse markdown file build htmls file and deploy to github page use blade of laravel What I like most about blade in recent versions of laravel is the support for view components, and I want to be able to use anonymous components (https://laravel.com/docs/master/blade#anonymous-components) in lina. Implementation {#implementation} Actually, the idea is simple so there is no need to elaborately write from scratch, installing packages of all kinds is almost enough to support the functions.


 

搭建基于go和js的静态博客程序norcia

 cd ~

git clone https://github.com/Besfim/Norcia/

cd Norcia

go build Norcia.go (此命令会在当前目录下,生成Norcia.exe)

$ ls
Norcia.exe*  Norcia_drawin_amd64  Norcia_win_amd64.exe*  TODO.md        blog.html  config.json  document/  google-code-prettify/  img/        js/          tags.html
Norcia.go    Norcia_linux_amd64   README.md              archives.html  build.sh*  css/         fonts/     icons/   index.html  search.html (可见当前目录~/norcia就是静态网站的根目录

$ ./Norcia.exe -p

显示:

...

---------- Norcia 博客预览服务 ----------

请访问: http://localhost:8666/index.html

按ctrl+c,终止运行 ./Norcia.exe -p

新建源帖:

cd document

nano  快乐的节日.md

cat 快乐的节日.md

显示:

此处写正文或html codes即可。

cd ..

nano config.json

(在 "articles": [ 这行的下一行加上:

{
            "title": "快乐的节日",
            "tag": "music,life",
            "create": "2024-11-01 09:26",
            "update": "2024-11-01 09:26",
            "mini": "这是一 首歌"
        },

 然后,

$ ./Norcia.exe -p 即可看到网站更新后的效果。( 一定要运行这一步。它首先起到更新网站的根目录的作用,然后才起到development server的作用)

演示网站:

https://norcia.dujun.bf/

https://besfim.github.io/Norcia/

https://zesty-torrone-5b488a.netlify.app/ 

https://velvety-mermaid-889a00.netlify.app/

项目地址:https://github.com/Besfim/Norcia