How to modify Laravel Spark sidebar view? - laravel

I'm using Spark for the subscription in Laravel for the first time and now I want to modify some changes on the Spark left sidebar.
I have published the Spark View file using the below command but don't know how to place some HTML on the left sidebar.
php artisan vendor:publish --tag=spark-lang

You can't easily change the HTML, but you can modify the billing portal text in the resources/lang/spark/en.json file. That file is intended to be used for translations, but in a pinch you can use it to change the default text.
If you need to change the HTML, you can find it in this Vue file: vendor/laravel/spark-stripe/resources/js/Pages/BillingPortal.vue (assuming that you're using Stripe).
However, any changes to that file will be overwritten when you update the package, so the best practice is to copy/fork the package. See these answers for more details.

Related

show text from config in typescript in laravel project

I have a typescript file checkout.ts inside a laravel project and in one line I want to show a custom message in toastr.error instead of the given text.
toastr.error("Please agree to the terms and conditions to proceed forward");
The custom text can come from the database or from any config file. How to do it?

Laravel 8.x Tailwind Prefix

Tailwind allows prefix to be set in tailwind.config.js.
Reference here.
I'm working on a Laravel project that uses Bootstrap and Tailwind simultaneously, managed by npm. I've set a prefix "tw-" for Tailwind to prevent classes colliding.
However, Laravel 8.x uses Tailwind by default unless set to use Bootstrap. Reference here.
Is there any way to let Laravel know about the Tailwind prefix that I set so that it uses the correct Tailwind class names?
Thanks in advance!
I wonder if it's truly necessary to use both tools for css.
Anyways I'm not entirely sure how you're loading the pagination, but you also have the ability to create your own (custom) pagination view.
By running the following code:
php artisan vendor:publish --tag=laravel-pagination
This command will place the views in your application's resources/views/vendor/pagination directory. The tailwind.blade.php file within this directory corresponds to the default pagination view. You may edit this file to modify the pagination HTML.
It might suite your needs a lot more to be able to have the pagination view file customized. Because with this you can recreate the pagination using Tailwind (or Bootstrap) classes.

Locating the main website (front page) file in cpanel for website built on laravel and voyager

I am trying to locate the file or folder in cpanel that the front page of my website is housed in so i can add a floating action button script to my website.
I just have no prior experience here.
(I am trying to add this in correct place)
It should have a finished result as here http://www.floatingactionbutton.com
The views or 'pages' of the application should be in the resources/views/ directory. You may find a view that is 'home' or something similar but there is no way of knowing what the views have been named when your application was developed.
The views may not be in straight HTML / PHP but rather use Laravel's Blade syntax.
In addition, existing javascript files in your site may have been compiled using Webpack. I imagine the floating action button will be a javascript script.
Can you get the original developer to add the script for you?

What is the most direct way to push a site update to Laravel?

I've SSH into the server and into the Laravel folder. I updated one of the html footer files but the changes aren't reflected on the website. I feel like I probably need to recompile something.
I tried deleting and re-creating the .env file (I backed it up first).
I've tried running the following commands:
php artisan clear-compiled
php artisan optimize
php artisan cache:clear
The only way I can seem to update the site is by updating the main.min.js file, located at /laravel/public/assets/js/main.min.js which is a terrible way to update the site.
How do I force Laravel to recreate this file or recompile the site based on changes I made to html template files within the site?
What am I missing here? I don't have any Laravel experience and am trying to update this site for a client.
edit:
I think I need to clarify a bit more...
The site appears to be rendered from this file: /public/assets/js/main.min.js
Most of the site's homepage, for example, is located in this js file. But the file is minified and therefore unwieldy to edit directly.
I am assuming (and I could be completely wrong here) that the file is generated from the html files located in the Laravel folder. To support this notion, I have found html files in other directories that correspond to the html located in the main.min.js file.
My assumption is that the previous developer would update the html files and then run something to compile the site into javascript files. But maybe this has nothing to do with Laravel, per se, and more to do with some frontend framework?
Try clearing the cached views...
php artisan view:clear
Laravel assets reside in
resources/assets/js
of your root directory you can have look their
if your file main.js is build using laravel mix have a on webpack.mix.js which compiles all your files you can get idea from that. make sure to run
npm run prod
if you change any file
Hope this helps?

Magento Multi Store themes calling same login.phtml file

I'm new to magento. Currently i'm developing two ecommerce sites using multi-store option in magento. Both the sites are 90% over, last night when i planned to customize the login page i was shocked. The reason is the changes made in first store login page also reflecting in second store also. The login page is curently calling from
frontend/default/default/template/persistent/customer/form/login.phtml
Is it possible to give any custom login page? PLz guide me magento experts......
Please update your post with your frontend/ folder structure down to each theme template folder. It might be that you don't have a copy of login.phtml in the second theme. Moreover you should follow templates best practices as:
Always create for a new shop different packaga. So not
frontend/default
but
frontend/yourcustompackage
Always have default theme left as much untouched, as possible. So in the
frontend/package/default
Should be some basic changes and rules of your package. It means for example in the putting reset.css for all of your themes. Or something like this.
As for me, each store view should have own theme. So, for example, storeview1
frontend/package/storeview1/
There you copy and change files specific for this theme. So, for example, in default you might have login.phtml. But you want storeview1 to have another login.phtml and in storeview2 it should be the same as in default. Therefore you copy the login.phtml from default to storeview1 and change it there. Don't forget to change package and theme in System->Configuration->Design. Package should be change for whole shop and theme should be specified for every store view or left untouched for default.
P.S. Magento theme fallbacks
P.P.S. Try this tutorial or google another one
P.P.P.S. I hope, you got the answer for your question.

Resources