Laravel Mix Artisan Serve
This extension allows you to automatically serve your Laravel app with php artisan serve with Laravel Mix.
Please make sure that you are using laravel-mix version 4.0 or higher.
This package only runs when the --watch flag is passed such as with the default npm run watch command from a default Laravel install.
Usage
You can install the package with npm or yarn:
npm install laravel-mix-artisan-serve --save-dev yarn add laravel-mix-artisan-serve --devThen require the extension in your Mix configuration:
const mix = require('laravel-mix'); require('laravel-mix-artisan-serve'); ...Enable the extension by calling .serve() at the end of your Mix chain:
mix.sass('resources/sass/app.scss', 'public/css').serve();This will serve your Laravel application at //localhost:8000 by default.
If you need to customize the host or port, you may pass an object to .serve():
mix.sass('resources/sass/app.scss', 'public/css').serve({ host: '127.0.0.1', port: '3000', });And you're done!
Contributing
Please see CONTRIBUTING for details.
Credits
- Adam Wathan (Adam is the inspiration behind this package (//twitter.com/adamwathan/status/1205840365120561153))
License
The MIT License (MIT). Please see License File for more information.
Run laravel project locally
Thank You helped me a lot
Hello...was trying to follow the procedure but once i got to this point
*Rename .env.example
file to .env inside your project root and fill the database information. (windows wont let you do it, so you have to open your console cd your project root directory and run mv .env.example .env )
When l tried running the mv.env.example command it shows mv is unrecognised what might be the problem?? Could you please help
Thank you Soo much thats helps me a lot
Когда я попытался запустить команду mv.env.example, он показывает, что mv не распознается, что может быть проблема ?? Не могли бы вы помочь
use [move .env.example .env]
Thanks a lot!
I had no idea where to start
Thank you. Also if you guys have images in the public folder, and your image functionality is not working, do not forget to use the artisan command storage:link for it to work again.
Great, it still works, although I had to upgrade my laravel installation and other dependencies first.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.Problem 1
- Installation request for doctrine/annotations v1.6.0 -> satisfiable by doctrine/annotations[v1.6.0].
- doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 2- Installation request for doctrine/inflector v1.3.0 -> satisfiable by doctrine/inflector[v1.3.0].
- doctrine/inflector v1.3.0 requires php ^7.1 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 3- Installation request for symfony/event-dispatcher v4.0.9 -> satisfiable by symfony/event-dispatcher[v4.0.9].
- symfony/event-dispatcher v4.0.9 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 4- Installation request for symfony/translation v4.0.9 -> satisfiable by symfony/translation[v4.0.9].
- symfony/translation v4.0.9 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 5- Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 6- Installation request for symfony/yaml v4.0.9 -> satisfiable by symfony/yaml[v4.0.9].
- symfony/yaml v4.0.9 requires php ^7.1.3 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 7- doctrine/inflector v1.3.0 requires php ^7.1 -> your PHP version (7.0.30) does not satisfy that requirement.
- laravel/framework v5.4.36 requires doctrine/inflector ~1.1 -> satisfiable by doctrine/inflector[v1.3.0].
- Installation request for laravel/framework v5.4.36 -> satisfiable by laravel/framework[v5.4.36].
Note: getting this error should i remove json file?or something else?
@rajucs
You need
to use a PHP version like 7.1 or more.
If you are using Windows, download composer and select the php version that you need. After that, restart Windows.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for cocur/slugify v3.2 -> satisfiable by cocur/slugify[v3.2].
- cocur/slugify v3.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 2- Installation request for erusev/parsedown 1.7.3 -> satisfiable by erusev/parsedown[1.7.3].
- erusev/parsedown 1.7.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 3- Installation request for laravel/framework v5.8.17 -> satisfiable by laravel/framework[v5.8.17].
- laravel/framework v5.8.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 4- Installation request for nicolaslopezj/searchable 1.10.4 -> satisfiable by nicolaslopezj/searchable[1.10.4].
- nicolaslopezj/searchable 1.10.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 5- Installation request for webonyx/graphql-php v0.13.4 -> satisfiable by webonyx/graphql-php[v0.13.4].
- webonyx/graphql-php v0.13.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 6- Installation request for phpunit/phpunit 7.5.11 -> satisfiable by phpunit/phpunit[7.5.11].
- phpunit/phpunit 7.5.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 7- cocur/slugify v3.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- cviebrock/eloquent-sluggable 4.8.0 requires cocur/slugify ^3.1 -> satisfiable by cocur/slugify[v3.2].
- Installation request for cviebrock/eloquent-sluggable 4.8.0 -> satisfiable by cviebrock/eloquent-sluggable[4.8.0].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/7.2/cli/php.ini
- /etc/php/7.2/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.2/cli/conf.d/10-opcache.ini
- /etc/php/7.2/cli/conf.d/10-pdo.ini
- /etc/php/7.2/cli/conf.d/15-xml.ini
- /etc/php/7.2/cli/conf.d/20-calendar.ini
- /etc/php/7.2/cli/conf.d/20-ctype.ini
- /etc/php/7.2/cli/conf.d/20-dom.ini
- /etc/php/7.2/cli/conf.d/20-exif.ini
- /etc/php/7.2/cli/conf.d/20-fileinfo.ini
- /etc/php/7.2/cli/conf.d/20-ftp.ini
- /etc/php/7.2/cli/conf.d/20-gettext.ini
- /etc/php/7.2/cli/conf.d/20-iconv.ini
- /etc/php/7.2/cli/conf.d/20-json.ini
- /etc/php/7.2/cli/conf.d/20-mysqli.ini
- /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.2/cli/conf.d/20-phar.ini
- /etc/php/7.2/cli/conf.d/20-posix.ini
- /etc/php/7.2/cli/conf.d/20-readline.ini
- /etc/php/7.2/cli/conf.d/20-shmop.ini
- /etc/php/7.2/cli/conf.d/20-simplexml.ini
- /etc/php/7.2/cli/conf.d/20-sockets.ini
- /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.2/cli/conf.d/20-sysvsem.ini
- /etc/php/7.2/cli/conf.d/20-sysvshm.ini
- /etc/php/7.2/cli/conf.d/20-tokenizer.ini
- /etc/php/7.2/cli/conf.d/20-wddx.ini
- /etc/php/7.2/cli/conf.d/20-xmlreader.ini
- /etc/php/7.2/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.2/cli/conf.d/20-xsl.ini
- /etc/php/7.2/cli/conf.d/20-zip.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.Some one can help.
@ghost You can run composer install --ignore-platform-reqs
When I update the composer this error will come. How can I fix this error ?
Thanks a lot! Was stuck on this for so long!
If this is a new installation, you need to run composer install
If it's an existing installation (vendor folder exists) run composer update
@xtniloy I have a factories folder as well. what php artisan command I should run?
When I update the composer this error will come. How can I fix this error ?
Just use another directory and use any terminal to. Laravel can be installed into any directory after you create it, using the command below.
Download composer using this link: //getcomposer.org/Composer-Setup.exe
It will install the composer for global usage. Then use command prompt or cmd.exe to execute below commands
composer create-project laravel/laravel projectname
It will install dependencies and you'd be able to run the server by going to the root directory of this project.
cd root directory which you just created
php artisan serv
It works. Thank you so much
./composer.json" does not match the expected JSON schema:
- type : Does not match the regex pattern ^[a-z0-9-]+$
ErrorException
require(C:\xampp\htdocs\cassation\routes\api.php): failed to open stream:
No such file or directory
Hello I Followed these ways that you mentioned but I got an error (PHP Warning: require(C:\Users\BB\Downloads\RMZ-main\RMZ-main/vendor/autoload.php): Failed to open stream: No such file or directory in C:\Users\BB\Downloads\RMZ-main\RMZ-main\artisan on line 18
Warning: require(C:\Users\BB\Downloads\RMZ-main\RMZ-main/vendor/autoload.php): Failed to open stream: No such file or directory in C:\Users\BB\Downloads\RMZ-main\RMZ-main\artisan on line 18
PHP Fatal error: Uncaught Error: Failed opening required
'C:\Users\BB\Downloads\RMZ-main\RMZ-main/vendor/autoload.php' (include_path='F:\xampp\php\PEAR') in C:\Users\BB\Downloads\RMZ-main\RMZ-main\artisan:18
Stack trace:
#0 {main}
thrown in C:\Users\BB\Downloads\RMZ-main\RMZ-main\artisan on line 18
Fatal error: Uncaught Error: Failed opening required 'C:\Users\BB\Downloads\RMZ-main\RMZ-main/vendor/autoload.php' (include_path='F:\xampp\php\PEAR') in C:\Users\BB\Downloads\RMZ-main\RMZ-main\artisan:18
Stack trace:
#0
{main}
thrown in C:\Users\BB\Downloads\RMZ-main\RMZ-main\artisan on line 18
PS C:\Users\BB\Downloads\RMZ-main\RMZ-main> )