Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-09-27 (6 months ago) ![]() | Not enough user ratings | Total: 14 | All time: 11,441 This week: 35![]() |
Version | License | PHP version | Categories | |||
laravel-pow 1.0 | Custom (specified... | 7.4 | User Management, Web services, PHP 7, A... |
<p align="center"> <img src="laravel-pow.svg" alt="Laravel Proof of Work" width="600"> </p>
This package implements a Proof of Work (PoW) system for Laravel applications with support for multiple front-end frameworks including Vue.js, React, and Angular.
composer require mohamedahmed01/laravel-pow
php artisan vendor:publish --provider="Mohamedahmed01\LaravelPow\LaravelPowServiceProvider" --tag="config"
php artisan vendor:publish --provider="Mohamedahmed01\LaravelPow\LaravelPowServiceProvider" --tag="vue-component"
# Or for React:
# php artisan vendor:publish --provider="Mohamedahmed01\LaravelPow\LaravelPowServiceProvider" --tag="react-component"
# Or for Angular:
# php artisan vendor:publish --provider="Mohamedahmed01\LaravelPow\LaravelPowServiceProvider" --tag="angular-component"
After publishing the configuration file, you can adjust the PoW settings in config/pow.php
:
return [
'difficulty' => env('POW_DIFFICULTY', 4),
'front_end' => env('POW_FRONT_END', 'vue'), // Options: 'vue', 'react', 'angular'
];
You can also set these values in your .env
file:
POW_DIFFICULTY=4
POW_FRONT_END=vue
The package provides two main API endpoints:
You can use these endpoints in your application as needed.
import ProofOfWork from './components/ProofOfWork.vue';
export default {
components: {
ProofOfWork,
},
// ...
}
<template>
<div>
<proof-of-work></proof-of-work>
</div>
</template>
import ProofOfWork from './components/ProofOfWork';
function App() {
return (
<div>
<ProofOfWork />
</div>
);
}
import { ProofOfWorkComponent } from './components/proof-of-work.component';
@NgModule({
declarations: [ProofOfWorkComponent],
// ...
})
export class AppModule { }
<app-proof-of-work></app-proof-of-work>
Generates a new Proof of Work challenge.
Response:
{
"challenge": "string",
"difficulty": number
}
Verifies a proof for a given challenge.
Request body:
{
"challenge": "string",
"proof": "string"
}
Response:
{
"status": "success" | "failure"
}
Contributions are welcome! Please feel free to submit a Pull Request.
This package is open-sourced software licensed under the MIT license.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.