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

18 October, 2022

Laravel Blade Hot Refresh With Vite

 Programing Coderfunda     October 18, 2022     Laravel, php     No comments   

 The Laravel team updated the first-party Laravel vite-plugin package to support full page reload on blade/arbitrary file changes. Vite will do a full page reload when you edit a blade template (or any other file you configure) that changes. No more manual browser refreshing is required during development!

The basic configuration in your vite.config.js file looks like the following when installing a new Laravel project:

1import { defineConfig } from 'vite';
2import laravel from 'laravel-vite-plugin';
3 
4export default defineConfig({
5 plugins: [
6 laravel({
7 input: [
8 'resources/css/app.css',
9 'resources/js/app.js'
10 ],
11 refresh: true,
12 }),
13 ],
14});

The above snippet is what ships with a brand-new Laravel application; you don't have to do anything to get hot reloads working on a new project.

Note the refresh config–when set to true, the Laravel Vite plugin will refresh the page when you update a file in the following paths:

1routes/**
2resources/views/**

That convention might work for most projects, but if you want to include other paths or files, you can configure the refresh property:

1import { defineConfig } from 'vite';
2import laravel from 'laravel-vite-plugin';
3 
4export default defineConfig({
5 plugins: [
6 laravel({
7 input: [
8 'resources/css/app.css',
9 'resources/js/app.js'
10 ],
11 refresh: [
12 'resources/routes/**',
13 'routes/**',
14 'resources/views/**',
15 ],
16 }),
17 ],
18});

See Working with Blade & Routes in the official documentation for further details on configuration options.

Try it out

Let's set up a demo Laravel application to demonstrate hot reloading. First, let's create a new demo project:

1laravel new blade-hot-reload --git
2cd blade-hot-reload

Once the project is installed, add the following somewhere to the <head/> of the welcome.blade.php file found in resources/views/:

1@vite('resources/js/app.js')

Next, you'll want to install NPM dependencies and run the dev command:

1npm install
2npm run dev

And that's it! If you make a change to a blade file or a route, you'll see something like the following in the console:

Vite page reload console output

Any change you make should reflect immediately, depending on your local development environment setup.

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

17 October, 2022

Laracon Online is now accepting speaker submissions

 Programing Coderfunda     October 17, 2022     Laravel, php     No comments   

 Laracon Online is returning on September 14th, 2022, and will continue to be streamed free for everyone on YouTube!

This event will feature the following speaking slots:

  • Eight main presentations that are 40 minutes.
  • Four lightning talks that are 15 minutes.

If you'd like to share your knowledge with 30,000+ fellow, Laravel developers submit your speaker application

Laracon Online also has a few sponsors spots remaining and would be a great way to get your brand in front of tens of thousands of Laravel developers.

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

Statix Server is an Object-oriented Wrapper for PHP's Built-in Server

 Programing Coderfunda     October 17, 2022     Laravel, php     No comments   

 Statix Server is an object-oriented wrapper around PHP's built-in server. Once you install the composer package, getting started is as minimal as the following:

1use Statix\Server\Server;
2 
3require_once './vendor/autoload.php';
4 
5Server::new()->start();
6 
7// or
8(new Server)->start();

The server class has an array-based configuration of options, or you can use the class' fluent API:

1Server::new()
2 ->usePHP('path')
3 ->onHost('localhost')
4 ->onPort('8080')
5 ->root('./content')
6 ->useRouter('./router.php')
7 ->withEnvVars([
8 'APP_DYNAMIC_ENV' => 'server'
9 ])->withoutEnvVars([
10 'APP_KEY',
11 ]);

It also supports use-cases like capturing server output, running in the background and programmatically stopping the server.

You can learn about this package, get full installation instructions, and view the source code on GitHub. This package uses PestPHP if you want to see an example in the wild of using Pest for testing!

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

Learn PestPHP From Scratch

 Programing Coderfunda     October 17, 2022     Laravel, php     No comments   

 Pest From Scratch is a free video course from Laracasts. Luke Downing walks you through the setup to becoming proficient with Pest PHP.

This course is 100% free (it doesn't even require signup) and includes eight episodes that cover installation through more advanced features:

  • Installation and Setup
  • Lifecycle Hooks
  • Expectations
  • Expectations++
  • Datasets
  • Combined Datasets
  • Groups, Exceptions, and Skipping Tests
  • Coverage and Parallel

At the end of this course, you'll be ready to use Pest PHP in your Laravel projects and packages. Check out this fantastic course (and excellent intro) today and get productive with the hottest testing framework for PHP.

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

Meta

Popular Posts

  • 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...
  • C++ in Hindi Introduction
    C ++ का परिचय C ++ एक ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। C ++ को Bjarne Stroustrup द्वारा विकसित किया गया था। C ++ में आने से पह...
  • Python AttributeError: 'str' has no attribute glob
    I am trying to look for a folder in a directory but I am getting the error.AttributeError: 'str' has no attribute glob Here's ...

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

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