Skip to content

Commit d73ac2a

Browse files
committed
feat: first commit of package
1 parent fb9b24a commit d73ac2a

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
/vendor/
3+
composer.lock

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Laravel Generator Helpers
2+
3+
This repo contains common helper functions which are used in different InfyOm laravel generator packages.
4+
5+
This can be useful to other packages as well.

composer.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "infyomlabs/laravel-generator-helpers",
3+
"description": "Helper functions for laravel generator packages",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Mitul Golakiya",
9+
"email": "me@mitul.me"
10+
}
11+
],
12+
"require": {
13+
"php": "^7.2.5",
14+
"illuminate/support": "^7.0"
15+
},
16+
"autoload": {
17+
"psr-4": {
18+
"InfyOm\\GeneratorHelpers\\": "src/"
19+
}
20+
}
21+
}

src/LaravelUtils.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace InfyOm\GeneratorHelpers;
4+
5+
class LaravelUtils
6+
{
7+
/**
8+
* Get full view path relative to the application's configured view path.
9+
*
10+
* @param string $path
11+
* @return string
12+
*/
13+
public static function getViewPath($path = '')
14+
{
15+
return implode(DIRECTORY_SEPARATOR, [
16+
config('view.paths')[0] ?? resource_path('views'), $path,
17+
]);
18+
}
19+
}

0 commit comments

Comments
 (0)