-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improves Create Command - flatpickr console warning (#1295)
* Refactor Create Command * Improve message * Fix phpstan * remove doctrine/dbal * fix phpstan * Fix create command * Fix phpstan
- Loading branch information
1 parent
1b43ac7
commit 5f4e786
Showing
10 changed files
with
174 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
namespace PowerComponents\LivewirePowerGrid\Commands\Actions; | ||
|
||
use Illuminate\Support\Facades\File; | ||
use Illuminate\Support\Str; | ||
|
||
class DependenciesCheck | ||
{ | ||
/** | ||
* Check if flatpickr is installed | ||
* | ||
*/ | ||
public static function flatpickr(): ?string | ||
{ | ||
$filesToCheck = [ | ||
base_path('tailwind.config.js'), | ||
base_path('resources/js/app.js'), | ||
]; | ||
|
||
$message = "\n💡 It seems you are not using the <comment>flatpickr</comment> plugin.\n Please check: <comment>https://livewire-powergrid.com/table/column-filters.html#filter-datetimepicker</comment> for more information."; | ||
|
||
foreach ($filesToCheck as $file) { | ||
if (File::exists($file) && !Str::contains(File::get($file), "flatpickr")) { | ||
return $message; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
/** | ||
* Check if openspout/openspout is installed | ||
* | ||
*/ | ||
public static function openspout(): ?string | ||
{ | ||
$file = base_path() . '/' . 'composer.json'; | ||
|
||
if (File::exists($file)) { | ||
$content = File::get($file); | ||
|
||
if (!Str::contains($content, "openspout/openspout")) { | ||
return("\n💡 It seems you are using the <comment>openspout/openspout</comment> package.\n Please check: <comment>https://livewire-powergrid.com/table/features-setup.html#exportable</comment> for more information."); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
/** | ||
* Check if TailwindForms is installed | ||
* | ||
*/ | ||
public static function tailwindForms(): ?string | ||
{ | ||
$file = base_path() . '/' . 'tailwind.config.js'; | ||
|
||
if (File::exists($file)) { | ||
$content = File::get($file); | ||
|
||
if (Str::contains($content, "require('@tailwindcss/forms')") === true) { | ||
return("\n💡 It seems you are using the plugin <comment>Tailwindcss/form</comment>.\n Please check: <comment>https://livewire-powergrid.com/get-started/configure.html#tailwind-forms</comment> for more information."); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.