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

14 February, 2022

Livewire Form Builder

 Programing Coderfunda     February 14, 2022     Laravel, Packages, php     No comments   

Livewire Form Builder


Livewire Form Builder


Filament Form Builder is a package you can use to build forms using the TALL (Tailwind, Alpine.js, Laravel, and Livewire) stack. This means that most of the work to create forms is done through PHP and Livewire components.

Here's a barebones example from the documentation:

1<?php
2 
3namespace App\Http\Livewire;
4 
5use Filament\Forms;
6use Illuminate\Contracts\View\View;
7use Livewire\Component;
8 
9class EditPost extends Component implements Forms\Contracts\HasForms
10{
11 use Forms\Concerns\InteractsWithForms;
12 
13 public Post $post;
14 
15 public $title;
16 public $content;
17 
18 public function mount(): void
19 {
20 $this->form->fill([
21 'title' => $this->post->title,
22 'content' => $this->post->content,
23 ]);
24 }
25 
26 protected function getFormSchema(): array
27 {
28 return [
29 Forms\Components\TextInput::make('title')->required(),
30 Forms\Components\MarkdownEditor::make('content'),
31 // ...
32 ];
33 }
34 
35 public function render(): View
36 {
37 return view('edit-post');
38 }
39}

The getFormSchema() method returns an array of fields, which includes a wide variety of field types:

  • Text input
  • Select
  • Multi-select
  • Checkbox
  • Toggle
  • Radio
  • Date-time picker
  • File upload
  • Rich editor
  • Markdown editor
  • And more...

Fields can also define validation rules for each data point in your form, such as required, unique, exists (in the database), and a bunch more. Here's an example:

1Field::make('email')->unique()
2Field::make('email')->unique(table: \App\Models\User::class)
3Field::make('email')->unique(column: 'email_address')

You can even make custom validation rules using closures or classes as you can in Laravel. You can use this package as a standalone package with Livewire or as part of the Filament TALL Stack Admin Panel

Head over to the form component documentation to get started. You can view the source code of this package on GitHub.

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

Blade Component to Serve Images and Download Files

 Programing Coderfunda     February 14, 2022     Laravel, Packages, php     No comments   

Blade Component to Serve Images and Download Files



rt makes it possible to serve images and download files from any location, including Laravel disks within a Laravel application. It enables resizing and caching images before sending them to the browser. Templates make it easy to preconfigure your settings to use them all over your site.

Smart enables easy image manipulation and downloads without any backend code:

  • serve images from anywhere, this might be a public path , a private path or a Laravel disk
  • resize images not only by defining height and width in the html image tag but by really resizing the content that is passed to the browser
  • apply templates to images, change the settings for all images from one place
  • automatically cache your images
  • apply the full intervention/image API to an image
  • download files from anywhere, this might be a public path , a private path or a Laravel disk

Using S3 as an example, here's how you can load an image from an S3 compatible storage disk:

1<x-smart-image data-disk="s3" src="logos/mybrand.jpg"/>

Smart downloading is another unique feature this package offers, making it possible to download any image or file with a blade component. No need to program the backend portion of the code to provide file streams; this package handles all of that:

1<x-smart-download src="{{ storage_path('manual.pdf') }}" target="_blank" />

The readme has plenty of examples to help you get started with this package. The author also has a video demonstration for those that want hands-on visual examples:

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


by laravel-news . com

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

Laravel Geographical Calculator

 Programing Coderfunda     February 14, 2022     Laravel, Packages, php     No comments   

Laravel Geographical Calculator

Laravel Geographical Calculator


Laravel Geographical Calculator helps you implement geographical calculation with several algorithms that help you deal with coordinates.

This package has two primary uses: getting the distance between a set of coordinates and getting the center between two or more coordinates.

First, here's an example of getting the distance between multiple sets of latitude and longitude points. The GeoFacade accepts various sets of points and calculates the distance between point one and point two, then points two and three, and so on.

1use \KMLaravel\GeographicalCalculator\Facade\GeoFacade;
2 
3$distance = GeoFacade::setPoint([22, 37])
4 ->setOptions(['units' => ['km']])
5 // you can set unlimited lat/long points.
6 ->setPoint([33, 40])
7 // get the calculated distance between each point
8 ->getDistance();

You can get the center between two sets of lat/long points using the getCenter() method. Like the getDistance() method, you can call setPoint() multiple times and it will calculate the center of multiple sets of points:

1// Get the calculated center between these points.
2$center = GeoFacade::setPoint([22, 37])
3 // you can set unlimited points.
4 ->setPoint([33, 40])
5 ->getCenter();

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
Newer Posts Older Posts Home

Meta

Popular Posts

  • Sitaare Zameen Par Full Movie Review
     Here’s a  complete Vue.js tutorial for beginners to master level , structured in a progressive and simple way. It covers all essential topi...
  • C++ in Hindi Introduction
    C ++ का परिचय C ++ एक ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। C ++ को Bjarne Stroustrup द्वारा विकसित किया गया था। C ++ में आने से पह...
  • 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...
  • 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...
  • 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...

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 (69)
  • 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

  • July (4)
  • 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