installing theme on laravel 5.6 on existed laravel - laravel

sb-admin-laravel-5-master theme is trying set up on my existed laravel project.
I have copied resources/view/ to my existed laravel project at resources/view/.
but problem is not working css or other stuffs as in theme and console has error
Loading failed for the with source “http://localhost/test1/ytl/public/assets/scripts/frontend.js”.
also done scripts folder:

If you use Gulp (gulpfile.js in your root folder) in your project, go to the root folder and run gulp in your console.
If you use Webpack (webpack.mix.js in your root folder), go to the root folder and run npm run dev in your console.
Of course in your gulpfile.js/webpack.mix.js-file there must be a copy command in it so it copies something from resources/assets/js/* to public/scripts/*.
For the gulpfile.js it would look similar to this:
mix.copy('resources/assets/js', 'public/build/js');

Related

Laravel + vite, Laravel not reading HMR files unless run build

I am having issues with a fresh installation using docker + laravel + vite.
I can currently load the blade template successfully, however, when I load my file in resources/js/app.js, it is failing as it cannot find the file.
In my blade template, I use #vite('resources/js/app.js') to load this file.
If I run npm run build it loads the file successfully, but if I am working with them by using the HRM npm run dev, laravel cannot find this file.
How can I resolve this? Should I move to mix for this?
Vite port was not exposed in my dockerfile. Now it works perfectly :D

500 issue with Laravel

I have seen this answer in many posts but they have not helped me at all. I followed the regular steps to create the laravel project like this:
I cloned from my repository.
I ran composer update.
I added 777 permissions to storage and bootstrap folders.
I have a .env file.
I verfied the .htacces and it's ok.
It is working in locahost, but when I try to replicate it in Hostinger it does not work, it displays the 500 server error. So I wonder what is the problem?
I checked the logs by the way and they were empty. I put the laravel project debugger to true too.
the website url is xellin.com
The debug:
The logs folder:
Thanks.
I think this is a good opportunity to point out how PHP / Laravel / Underlying Server interacts one to each other.
First:
The HTTP server inspects Document Root and .htaccess to get instructions.
If the file is .php (like Laravel), then it CALLS to the php handler.
The php handler could be a FPM version or a Fast CGI version.
-> If an error ocurrs parsing the .htaccess or with the initial interaction between Http Server and PHP... Laravel never runs for real. All ends in a PHP error log
To find out what's wrong, you need to inspect what PHP / Http Server said about the error in their respective logs.
In short words: at this point is not a Laravel error, but a server/php one.
Second:
If Apache/PHP runs well, then PHP executes the Laravel Applicacion Lifecycle... if Laravel encounters a problem, then you will see the usual output error of Laravel Error Handler.
I think this is a must to know to work with web apps in general, because many times developers miss to catch if the problem was with Laravel, or with PHP / Server itself.
As a side note, that's why it is important to know how to choose propper hosting service for Laravel.
Thanks for reading.
You can try to clear cache
Like as
php artisan optimize
Or
You can manually delete cache files which is located in bootstrap folder and inside bootstrap folder you can see cache folder inside cache folder delete all files except git ignore file your issue fix
If you show again this error on live serve then tou can update your composer and then run
php artisan optimize
at first, if you give any of your folders 777 permissions, you are allowing ANYONE to read, write and execute any file in that directory.... what this means is you have given ANYONE (any hacker or malicious person in the entire world) permission to upload ANY file, virus or any other file, and THEN execute that file...so please be careful because IF YOU ARE SETTING YOUR FOLDER PERMISSIONS TO 777 YOU HAVE OPENED YOUR SERVER TO ANYONE THAT CAN FIND THAT DIRECTORY. please read the full explanation from here
the second here is the detailed steps I used to deploy my projects to the server:
run npm run production then update your github repo.
clone the project from GITHUB to server - clone to an outside folder (not public_html folder)
run cd <cloned folder name>
run composer install
run npm install
copy and configure .env file to cloned folder( be sure name is .env not env).
copy all content of cloned_project_folder_name/public to public_html folder
in index.php inside public_html folder edit as below
$app = require_once __DIR__.'/../cloned_project_folder_name/bootstrap/app.php';
require __DIR__.'/../cloned_project_folder_name/vendor/autoload.php';
set your .htaccess properly.
change permission to 755 to index.php and all file in public_html folder
run composer install --optimize-autoloader --no-dev
run php artisan config:cache
run php artisan route:cache
I think I state it all, hope that will help

Changes in the vue file not applying in the browser

I am working in project having technology(laravel + vuejs).In that there is a form created in vue file and i want to add a text in the vue file.So as i have seen that "when any changes is done in vue file then need to rebuild the application".And i see that there are commands for rebuild the application is npm run dev , npm run prod , npm run watch and npm run watch-poll. I have tried all this commands after saving the file through FTP but sometimes the changes is applied (Note : Not immediately but after some duration) and sometimes no changes apply in the browser.When i tried the above command by executing it then there is no such error occurs and the rebuild is done successfully.So what will be the issue can you please suggest something that i need to configure?
Below is the code of package.json,webpack.mix.js file and after that i have attached image of putty in which application rebuild is done.
Thanks in advance!
I think you are not understanding what npm run dev/prod/watch do. If you alter the .vue file in your resources folder, then have npm rebuild your assets, then ftp the vue file to your server, nothing should happen.
Depending on how you have your laravel mix file set-up, the file you need to ftp to the server is likely public/js/app.js.
You should really consider getting your local environment setup for development, there is nothing I can image worse than viewing your changes by ftp-ing files to a server.

how to Deploy VueJS, laravel App on live server

i want to deploy the App of laravel with inbuilt vuejs
on my local i just run the "PHP ARTISAN SERVE"
and boom its works for me
but what about the live ?
its not working on live server
my .htaccess and index.php is in public folder
for Laravel we just move the index.php and .htaccess out of public folder and edit some code lines and it will work.
but how it will work with vuejs templates ?
Follow these steps:
Please create a zip folder of your project except the vendor folder.
Deploy the folder on live and extract.
Change your DB and other configuration in env file.
In the terminal on live server, run this command : composer update
After the installation, look for your front page.
Hope it should work fine.

Error while creating migrations table with laravel: "No such file or directory"

When trying to run php artisan migrate:make create_users_table I get the following output in Windows CMD:
{"error":{"type":"ErrorException","message":"require(C:\...\\localhost
\\sites\\makeitsnappy\\app\/filters.php): failed to open stream: No such file or
directory","file":"C:\\...\localhost\\sites\\makeitsnappy\\app\\start
\\global.php","line":83}}
I'm running Windows 8. Laravel 4 and installed Composer, also ran composer update in the project folder. Same error happens.
Edit: Loading the application webpage, I get:
require(C:\.../localhost\sites\makeitsnappy\app/filters.php): failed to open stream: No such file or directory
Also, there is no filter.php file.
How can I fix this problem?
Since Laravel4 the routes and filters are in two different files: routes.php and filters.php not like in Laravel3 where both lay in the same file.
Check if there is a filter.php file in you app/ folder.
The error occurs because the autoloader tries to load this file on application's startup to get the filters for the called route or global filters.
Running composer update won't help here because you only get the framework and it's dependencies via composer and it doesn't update your app/ folder.
did you do composer install? It downloads some important files. I think you missed this command!
composer install

Resources