CoderFunda
  • Home
  • About us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • About us
  • Home
  • Php
  • HTML
  • CSS
  • JavaScript
    • JavaScript
    • Jquery
    • JqueryUI
    • Stock
  • SQL
  • Vue.Js
  • Python
  • Wordpress
  • C++
    • C++
    • C
  • Laravel
    • Laravel
      • Overview
      • Namespaces
      • Middleware
      • Routing
      • Configuration
      • Application Structure
      • Installation
    • Overview
  • DBMS
    • DBMS
      • PL/SQL
      • SQLite
      • MongoDB
      • Cassandra
      • MySQL
      • Oracle
      • CouchDB
      • Neo4j
      • DB2
      • Quiz
    • Overview
  • Entertainment
    • TV Series Update
    • Movie Review
    • Movie Review
  • More
    • Vue. Js
    • Php Question
    • Php Interview Question
    • Laravel Interview Question
    • SQL Interview Question
    • IAS Interview Question
    • PCS Interview Question
    • Technology
    • Other

31 January, 2022

Real-Time Chat Package for Laravel

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

 

Chatify is a Laravel package by Munaf Aqeel Mahdi that adds a complete real-time chat system to your application without any additional code:

Chatify uses Laravel’s Pusher integration for chat functionality, with the following features:

  • Users / groups (soon) chat system.
  • Real-time contacts list updates.
  • Favorites contacts list (Like stories style) and “add to favorites” button.
  • Saved Messages to save your messages online like Telegram messenger app.
  • Search functionality.
  • Contact item’s last message indicator (e.g. You: ….).
  • Real-time user’s active status.
  • Real-time typing indicator.
  • Real-time seen messages indicator.
  • Real-time internet connection status.
  • Upload attachments (Photo/File).
  • Shared photos, delete conversation.. (User’s info right side).
  • Responsive design with all devices.
  • User settings and chat customization : user’s profile photo, dark mode and chat color. with simple and wonderful UI design.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Real-Time Chat Package for Laravel

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

Chatify is a Laravel package by Munaf Aqeel Mahdi that adds a complete real-time chat system to your application without any additional code:

Chatify uses Laravel’s Pusher integration for chat functionality, with the following features:

  • Users / groups (soon) chat system.
  • Real-time contacts list updates.
  • Favorites contacts list (Like stories style) and “add to favorites” button.
  • Saved Messages to save your messages online like Telegram messenger app.
  • Search functionality.
  • Contact item’s last message indicator (e.g. You: ….).
  • Real-time user’s active status.
  • Real-time typing indicator.
  • Real-time seen messages indicator.
  • Real-time internet connection status.
  • Upload attachments (Photo/File).
  • Shared photos, delete conversation.. (User’s info right side).
  • Responsive design with all devices.
  • User settings and chat customization : user’s profile photo, dark mode and chat color. with simple and wonderful UI design.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

PHP Progress Library to Track User Progress

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

 

Progress is a PHP package to determine steps and progress with an expressive, object-oriented API:

This progress package is a simple way of taking multiple steps in a process and using them to create a progression system. You can define your steps through an expressive and simple API and let this package handle the heavy lifting. The result is a delightfully easy to use steps-and-progression system.

This library works by creating a Progress instance with all the steps required to reach 100% progression. This library then asserts which steps are completed and returns the results:

use Mtownsend\Progress\Progress;
use Mtownsend\Progress\Step;
 
$step1 = (new Step('https://marktownsend.rocks', 'Portfolio Site'))->url();
$step2 = (new Step(4, 'Bronze Level Developer'))->integer()->between(1, 5);
$progress = (new Progress($step1, $step2));
 
var_dump($progress->get());
 
/*
array(7) {
'total_steps' => int(2)
'percentage_complete' => double(100)
'percentage_incomplete' => double(0)
'steps_complete' => int(2)
'steps_incomplete' => int(0)
'complete_step_names' => array(2) {
[0] =>
string(14) "Portfolio Site"
[1] =>
string(22) "Bronze Level Developer"
}
'incomplete_step_names' => array(0) {}
}
*/

As you can see, the above example’s progress is 100% because all of the data passed to each Step passes the assertion test.

Let’s say the user hadn’t reached “Bronze Level Developer” yet; you might dynamically generate the progress instance like so:

use Mtownsend\Progress\Progress;
use Mtownsend\Progress\Step;
 
$developerLevel = 0;
 
$step1 = (new Step('https://marktownsend.rocks', 'Portfolio Site'))->url();
$step2 = (new Step($developerLevel, 'Bronze Level Developer'))->integer()->between(1, 5);
 
$progress = (new Progress($step1, $step2));
 
var_dump($progress->get());
 
/*
array(7) {
'total_steps' => int(2)
'percentage_complete' => double(50)
'percentage_incomplete' => double(50)
'steps_complete' => int(1)
'steps_incomplete' => int(1)
'complete_step_names' => array(1) {
[0] => string(14) "Portfolio Site"
}
'incomplete_step_names' => array(1) {
[1] => string(22) "Bronze Level Developer"
}
}
*/

The Progress library uses beberlei/assert under the hood. Thus you have full access to the assert library methods. In the above example, step two must be an integer between one and five, for example.

You can also assert if an individual step passes using the passed() method:

<br></br>// Failing example
$developerLevel = 0;
 
$step2 = (new Step($developerLevel, 'Bronze Level Developer'))->integer()->between(1, 5);
 
var_dump($step2->passed()); // bool(false)
 
// Passing
$developerLevel = 1;
 
$step2 = (new Step($developerLevel, 'Bronze Level Developer'))->integer()->between(1, 5);
 
var_dump($step2->passed());
// bool(true)

You can learn more about this package, get full installation instructions, and view the source code on GitHub at mtownsend5512/progress.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Generate and Extract Random Data with RandoPHP

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

RandoPHP is a package by Roberto Butti that implements random generators (Integer, Char, Byte, etc.) and takes random samples from arrays. This package can be broken down into two distinct types of operations: generating things and drawing from existing arrays.

RandoPHP provides a fluent interface to generate integers, dates, floats, etc. to help you generate data:

// Generate char
Randomize::char()->numeric()->generate();
Randomize::char()->alpha()->generate();
Randomize::char()->alphanumeric()->generate();
 
// Generate a boolean (flip a coin)
Randomize::boolean()->generate();
 
// Generate floats and integers
$randomFloat = Randomize::float()->generate();
$randomFloat = Randomize::float()->min(0)->max(90)->generate();
$randomNumber = Randomize::integer()->min(1)->max(6)->generate();
$randomNumber = Randomize::integer()->range(1,6)->generate();
 
// Generate sequences (i.e. roll the dice 15 times)
$randomRolls = Randomize::sequence()
->min(1)
->max(6)
->count(15)
->generate();
 
// Generate a random sequence of 10 alpha-numeric chars
Randomize::sequence()
->chars()
->alphanumeric()
->count(10)
->generate();

Secondly, you can draw random stuff from existing arrays using the Draw class:

<br></br>$array=["React.js", "Vue.js", "Svelte.js", "Angular.js" , "Alpine.js", "Vanilla js"];
 
// Draw one
$randomJs = Draw::sample($array)->extract();
 
// Draw three
$randomJs = Draw::sample($array)->count(3)->extract();
 
// Draw three, duplicates allowed
$randomJs = Draw::sample($array)
->count(3)
->allowDuplicates()
->extract();

The examples in this article were taken from the project’s readme, which has full details on usage. You can view this package’s source code on GitHub at Hi-Folks/rando-php.


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Eloquent State Machines

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

 

Eloquent State Machines is a package by Andrés Santibáñez that simplifies transitioning the states of Eloquent models:

During this weekend, I started working on a new package for @laravelphp to manage state machines for Eloquent models. Had so much fun and learned a ton in the process.

I've just tagged v1.0.0. Enjoy!https://t.co/9CrZ4azz3C

Feedback welcomed!

— Andrés Santibáñez (@asantibanez) December 7, 2020

Transitioning states is accomplished by defining the transition logic in a specific state machine. Here’s an example from the readme of a SalesOrder model:

// 'pending', 'approved', 'declined' or 'processed'
$salesOrder->status;
// null, 'pending', 'completed'
$salesOrder->fulfillment;
 
//
// Transition state examples
//
 
$salesOrder->status()->transitionTo('approved');
$salesOrder->fulfillment()->transitionTo('completed');
 
// Transition with custom properties
$salesOrder->status()->transitionTo('approved', [
'comments' => 'Customer has available credit',
]);

Here are some examples of checking the transition history:

$salesOrder->status()->was('approved');
$salesOrder->status()->timesWas('approved');
$salesOrder->status()->whenWas('approved');
$salesOrder->fulfillment()->snapshowWhen('completed');
$salesOrder->status()->history()->get();

Finally, here’s an example of how a model might consume this package:

namespace App\Models;
 
use App\StateMachines\SalesOrders\StatusStateMachine;
use Asantibanez\LaravelEloquentStateMachines\Traits\HasStateMachines;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
 
class SalesOrder extends Model
{
use HasFactory;
use HasStateMachines;
 
public $stateMachines = [
'status' => StatusStateMachine::class,
];
}

Andrés has a demo application available to demonstrate how to use this package with Laravel. You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Fast Excel Package for Laravel

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

 

Fast Excel is a Laravel package for importing and exporting spreadsheets. It provides an elegant wrapper around Spout—a PHP package to read and write spreadsheet files in a quick and scalable way. It is capable of processing large files, all while keeping the memory usage low.

Here’s an example of exporting models or collections to an Excel file:

use Rap2hpoutre\FastExcel\FastExcel;
use App\User;
 
// Export a User model
$users = User::all();
(new FastExcel($users))->export('file.xlsx');
 
// Export a collection Collection
$list = collect([
[ 'id' => 1, 'name' => 'Jane' ],
[ 'id' => 2, 'name' => 'John' ],
]);
 
(new FastExcel($list))->export('file.xlsx');

You can use the download method to force the user’s browser to download a file:

return (new FastExcel(User::all()))->download('file.xlsx');

You can also import and export multiple sheets:

$sheets = new SheetCollection([
User::all(),
Project::all()
]);
(new FastExcel($sheets))->export('file.xlsx');
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel Macroable Models Package

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

 

Javier Ugarte released a package called Laravel Macroable Models for adding methods to Laravel models on the fly:

The package offers developers an easy way of programmatically adding methods to Laravel Eloquent models. Behind the scenes, it makes use of Laravel’s macroable trait.

The idea of macorable models has controversy around it, but the package author describes his particular use-case and solution in his writeup about the package. As always, be sure to explore your use-case, and in general macroable models won’t be necessary for most use-cases.

With that said, let’s check out what this package provides:

You can define a macro for a model through a service provider boot() method. The package keeps track of macros for each model.

// app/Providers/AppServiceProvider.php
 
use \Javoscript\MacroableModels\Facades\MacroableModels;
use \App\User;
 
public function boot()
{
MacroableModels::addMacro(User::class, 'sayHi', function() {
return "Hello, {$this->name}!";
});
}
 
\App\User::first()->sayHi();

As you can see in the example above, this package takes care of context binding so you can use $this inside macro functions.

Here are a few more functions the package provides:

MacroableModels::modelsThatImplement('sayHi');
/* [
"App\User",
] */
 
// Return all macros for a model
MacroableModels::macrosForModel(\App\User::class);
// Get all registered macros
MacroableModels::getAllMacros();

Learn More

I want to reiterate that this package has a narrow, unique use-case. Typically, you wouldn’t need macros to define model methods on-the-fly. I’d recommend reading the author’s writeup about this package and his inspiration behind it.

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Extract Untranslated Strings from Laravel Projects

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

 

Localizator is a small tool for Laravel that gives you the ability to extract untranslated strings from project files. It works using the artisan command line and the provided localize command:

php artisan localize de,fr

The above command will create a de.json and fr.json file in the resources/lang folder or add missing keys if these files already exist.

You can also use the configuration value in app.locale by running the command without arguments:

# Use the `config('app.locale')` value
php artisan localize

The package also provides configurable values to suit your project’s needs, along with sensible defaults:

return [
 
/**
* Search criteria for files.
*/
'search' => [
/**
* Directories which should be looked inside.
*/
'dirs' => ['resources/views'],
 
/**
* Patterns by which files should be queried.
* The values can be a regular expresion, glob, or just a string.
*/
'patterns' => ['*.php'],
 
/**
* Functions that the strings will be extracted from.
* Add here any custom defined functions.
* NOTE: The translation string should always be the first argument.
*/
'functions' => ['__', 'trans', '@lang']
],
 
/**
* Should the localize command sort extracted strings alphabetically?
*/
'sort' => true,
 
];

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Bandwagon is a Social Proof Package for Laravel

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

 

Laravel Bandwagon is a package to help promote social proof and legitimacy within your application. You can let users of your application know when others’ share, purchase, subscribe, or donate, for example:

Using blade and Vue, here’s how easy it is to feed data into the social proof component, which is then displayed in the user’s browser via polling:

use Bndwgn\Bandwagon\Bandwagon;
 
public function purchase(Request $request, Product $product)
{
$user = Auth::user();
// ... logic to charge a customer
Bandwagon::createEvent(
"Someone from ${$user->state}",
"Purchased the ${$product->displayName} plan",
$request->ip()
);
}

In your blade template (i.e., on your product page), you render the widget by using the provided blade component:

<x-bandwagon-renderer />

The package allows you to configure things like poll increments (how often to check for new events), how long to display events, and the age of valid events.

Bandwagon’s documentation is available on www.laravelbandwagon.com, and you can learn more about this package’s source code on GitHub.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Snappy Image Wrapper for Laravel

 Programing Coderfunda     January 31, 2022     Laravel, Packages, php     No comments   

 

Snappy is a PHP library allowing thumbnails, snapshots, and PDF generation from a URL or HTML page. Barry vd. Heuvel is the author of a Laravel Snappy (which has been around since Laravel 5), making it even easier to integrate with Laravel:

// Generate a PDF From a view
$pdf = PDF::loadView('pdf.invoice', $data);
$pdf->download('invoice.pdf');
 
// Generate a PDF from a URL
PDF::loadFile('https://www.github.com')
->inline('github.pdf');
 
// Change the orientation and paper size
PDF::loadHtml($html)
->setPaper('a4')
->setOrientation('landscape')
->setOption('margin-bottom', 0)
->save('myfile.pdf');

Along with some nifty convenience methods, Snappy for Laravel has testing features to help you assert things that Snappy generates:

PDF::fake();
 
// Perform order shipping...
 
PDF::assertViewIs('view-pdf-order-shipping');
PDF::assertSee('Name');

Snappy requires the wkhtmltopdf (available on Windows, Mac, and Linux), which is a command-line tool to render HTML into PDF and various image formats. Installation instructions are available in the readme so you can ensure wkhtmltopdf is installed and the path configured properly.

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Meta

Popular Posts

  • Write API Integrations in Laravel and PHP Projects with Saloon
    Write API Integrations in Laravel and PHP Projects with Saloon Saloon  is a Laravel/PHP package that allows you to write your API integratio...
  • Credit card validation in laravel
      Validation rules for credit card using laravel-validation-rules/credit-card package in laravel Install package laravel-validation-rules/cr...
  • Fast Excel Package for Laravel
      Fast Excel is a Laravel package for importing and exporting spreadsheets. It provides an elegant wrapper around Spout —a PHP package to ...
  • iOS 17 Force Screen Rotation not working on iPAD only
    I have followed all the links on Google and StackOverFlow, unfortunately, I could not find any reliable solution Specifically for iPad devic...
  • Features CodeIgniter
    Features CodeIgniter There is a great demand for the CodeIgniter framework in PHP developers because of its features and multiple advan...

Categories

  • Ajax (26)
  • Bootstrap (30)
  • DBMS (42)
  • HTML (12)
  • HTML5 (45)
  • JavaScript (10)
  • Jquery (34)
  • Jquery UI (2)
  • JqueryUI (32)
  • Laravel (1017)
  • Laravel Tutorials (23)
  • Laravel-Question (6)
  • Magento (9)
  • Magento 2 (95)
  • MariaDB (1)
  • MySql Tutorial (2)
  • PHP-Interview-Questions (3)
  • Php Question (13)
  • Python (36)
  • RDBMS (13)
  • SQL Tutorial (79)
  • Vue.js Tutorial (68)
  • Wordpress (150)
  • Wordpress Theme (3)
  • codeigniter (108)
  • oops (4)
  • php (853)

Social Media Links

  • Follow on Twitter
  • Like on Facebook
  • Subscribe on Youtube
  • Follow on Instagram

Pages

  • Home
  • Contact Us
  • Privacy Policy
  • About us

Blog Archive

  • September (100)
  • August (50)
  • July (56)
  • June (46)
  • May (59)
  • April (50)
  • March (60)
  • February (42)
  • January (53)
  • December (58)
  • November (61)
  • October (39)
  • September (36)
  • August (36)
  • July (34)
  • June (34)
  • May (36)
  • April (29)
  • March (82)
  • February (1)
  • January (8)
  • December (14)
  • November (41)
  • October (13)
  • September (5)
  • August (48)
  • July (9)
  • June (6)
  • May (119)
  • April (259)
  • March (122)
  • February (368)
  • January (33)
  • October (2)
  • July (11)
  • June (29)
  • May (25)
  • April (168)
  • March (93)
  • February (60)
  • January (28)
  • December (195)
  • November (24)
  • October (40)
  • September (55)
  • August (6)
  • July (48)
  • May (2)
  • January (2)
  • July (6)
  • June (6)
  • February (17)
  • January (69)
  • December (122)
  • November (56)
  • October (92)
  • September (76)
  • August (6)

Loading...

Laravel News

Loading...

Copyright © CoderFunda | Powered by Blogger
Design by Coderfunda | Blogger Theme by Coderfunda | Distributed By Coderfunda