How to tell what version of laravel from laravel full files? - laravel

I have a question to ask about laravel: How to tell what version of laravel from the laravel full files?
I have a laravel files which I cannot tell what version is it.

Go to project root directory and run php artisan command. The output will start from something like:
Laravel Framework version 5.3.30
5.3.30 is the version of Laravel used in this project.

Go to Your project's root directory in command prompt and hit command like:
php artisan -V
You will get your laravel version Laravel Framework version 5.3.30 like that

If you can't or don't want to use artisan (php artisan --version), open vendor/laravel/framework/src/Illuminate/Foundation/Application.php you will find const VERSION = '...'; defined in the class.

Related

Laravel 9 - Jetstream with Bootstrap (Jetstrap). Missing app.css and shows ugly view

I'm following this video tutorial (in spanish), which shows how to implement Jetstream with Bootstrap instead of Tailwinds: https://www.youtube.com/watch?v=Wt-OuBX6lEc&list=PLZ2ovOgdI-kWWS9aq8mfUDkJRfYib-SvF&index=31
The issue is this one: despite I've followed the steps strictly, I'm getting two important errors.
First of all, I should have a file named "app.css" into my folder "/public/css", but I don't. I don't have even a folder named 'css' into the 'public' directory, neither another lots of folders I should.
On the other hand, both my welcome view and my register view look ugly, like this:
The commands I've done are these ones:
Into:
leandro#leandro-Lenovo-B50-10:/var/www/html$
laravel new bootstrap --jet
cd bootstrap
Then,into:
leandro#leandro-Lenovo-B50-10:/var/www/html/bootstrap$
composer require nascent-africa/jetstrap --dev
php artisan jetstrap:swap livewire
npm install
npm run dev
php artisan migrate
sudo chmod -R 777 .
Also, the register view shows an error, unless I have activated VITE (with npm run dev).
Somewhere, I had to do a 'php artisan migrate:fresh', because a migration error.
I'm running the project into an Apache server.
I'm using:
Linux Mint 21 Vanessa
Apache/2.4.52 (Ubuntu)
PHP 8.2.1
Laravel v9.50.2
Does anyone have an idea of what's going wrong? It might be a conflict version, since I'm using Laravel 9, while the video is explained for Laravel 8.
I don't know if there's any additional information needed.
Thanks a lot!

How to Upgrade Laravel 5.4 to Laravel 7.12

In my old project laravel 5.4, use zizaco/entrust and it's doesn't support laravel 7. So I would like to use spatie/laravel-permission.
Could you please guide me how to do it.
Yes I got the solution to this issue. Please go through the steps I have used.
-Run command php artisan make:provider EntrustCustomServiceProvider -go to app/Providers/EntrustCustomServiceProvider.php Use Auth; and Write in the boot function
Link
Check this method:
Now I found other github name greatsami-master support for laravel 7 (it's forked from zizaco entrust too).https://github.com/greatsami/entrust

How to know Laravel version and where is it defined?

How to know Laravel version and where is it defined?
Is Laravel version is defined inside my application directory or somewhere in global server side directory?
UPDATE
Sorry, the main question is where the version is defined? Where does
php artisan --version
takes it's answer?
UPDATE 2
The goal is to investigate, who (of us) has changed Laravel version on our site. Could it be changed by github repository edition only? Or server write access was also required?
run php artisan --version from your console.
The version string is defined here:
https://github.com/laravel/framework/blob/master/src/Illuminate/Foundation/Application.php
/**
* The Laravel framework version.
*
* #var string
*/
const VERSION = '5.5-dev';
1) php artisan -V
2) php artisan --version
AND its define at the composer.json file
"require": {
...........
"laravel/framework": "^6.2",
...........
},
If you want to know the specific version then you need to check composer.lock file and search For
"name": "laravel/framework",
you will find your version in next line
"version": "v5.7.9",
If you want to know the user version in your code, then you can use using app() helper function
app()->version();
It is defined in this file ../src/Illuminate/Foundation/Application.php
Hope it will help :)
CASE - 1
Run this command in your project..
php artisan --version
You will get version of laravel installed in your system like this..
CASE - 2
Also you can check laravel version in the composer.json file in root directory.
Step 1:
go to: /vendor/laravel/framework/src.Illuminate/Foundation:
Step 2:
Open application.php file
Step 3:
Search for "version". The below indicates the version.
Run this command in your project folder location in cmd
php artisan --version
Yet another way is to read the composer.json file, but it can end with wildcard character *
Multiple way we can find out laravel version such as,
Using Command
php artisan --version
or
php artisan -v
From Composer.json
From Vendor Directory
/vendor/laravel/framework/src/Illuminate/Foundation/Application.php
In your Laravel deployment it would be
/vendor/laravel/framework/src/Illuminate/Foundation/Application.php
to see who changed your Laravel version look at what's defined in composer.json. If you have "laravel/framework": "5.4.*", then it will update to the latest after composer update is run. Composer.lock is the file that results from running a composer update, so really see who last one to modify the composer.json file was (hopefully you have that in version control). You can read more about it here https://getcomposer.org/doc/01-basic-usage.md
You can also check with composer:
composer show laravel/framework
If you're like me and want to show the Laravel version and app version on the footer you can create a Blade directive in AppServiceProvider. Blade directives are placed in the boot method of the AppServiceProvider and example code may like something like
Blade::directive('laravelVersion', function () {
return "<?php echo app()->version(); ?>";
});
then in the blade template, you call it like #laravelVersion and it will show the current laravel version.
If you want, you can read more about blade directive here
You can find this on Composer.json file -> root directory
You can view the result of dd(\Illuminate\Foundation\Application::VERSION)

LARAVEL: What laravel x is version 1.3.3?

I'm beginner in Laravel framework. I want to know if I'm using Laravel 5? or the number of Laravel I'm using. Thank you!
EDIT: I'm using windows platform
Two ways:
In your laravel home directory, type:
php artisan --version
Or you can check in this file:
vendor\laravel\framework\src\Illuminate\Foundation\Application.php
where you will see something like:
const VERSION = 'x.x.xx';
Taken from here.
You can see the version of your Laravel installation in composer.json. Take a look at it and search for this line:
"laravel/framework": "5.2.*",
You can also do
php artisan --version
from your terminal / dos prompt
Take a look at the Laravel release notes for more information about the Laravel versions: https://laravel.com/docs/5.2/releases
With command Prompt
php artisan --version
or
Go to composer.json
you will find "laravel/framework": "5.5.*", something like this

Adding a php library into laravel 4

I'm new to laravel and I would like to ask how to install php markdown library into Laravel 4?
I know how to install a laravel package, but I have no idea on how to install a php file.
Do anyone know how to install it? or using composer?
Library source: http://michelf.ca/projects/php-markdown/
The library is exist on packagist anyway: https://packagist.org/packages/michelf/php-markdown , so you can use composer. Edit composer.json add following line to "require" property:
"michelf/php-markdown": "1.4.*"
run:
composer update
Now you can use it like:
\Michelf\Markdown::defaultTransform($my_text);

Resources