Skip to content

Commit

Permalink
themes controller feature
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Aug 4, 2021
1 parent fb8feec commit 61d7def
Show file tree
Hide file tree
Showing 12 changed files with 290 additions and 29 deletions.
19 changes: 10 additions & 9 deletions .idea/flkv2.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 27 additions & 19 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ function theme_assets($path){
return url('themes/'.$theme_name.'/'.$path);
}
}

if(!function_exists('theme_namespace')){
function theme_namespace(){
$theme_name = str_replace('themes.', '', setting('themes.path'));
return 'Themes\\' . $theme_name . '\\controllers';
}
}

if(!function_exists('show_menu')){
function show_menu($key){
$menu = \App\Models\Setting::where('key', $key)->first();
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"Brackets\\Craftable\\": "app/Core/brackets/craftable/src/",
"Brackets\\Media\\": "app/Core/brackets/media/src/",
"Brackets\\Translatable\\": "app/Core/brackets/translatable/src/",
"Modules\\": "Modules/"
"Modules\\": "Modules/",
"Themes\\": "resources/views/themes"
}
},
"autoload-dev": {
Expand Down
31 changes: 31 additions & 0 deletions database/migrations/2021_07_29_155225_create_menus_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMenusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('menus', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('menus');
}
}
31 changes: 31 additions & 0 deletions database/migrations/2021_07_29_155232_create_menus_items_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMenusItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('menus_items', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('menus_items');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateItemsPricesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('items_prices', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('items_prices');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php


namespace Themes\Controller3x1\controllers;


class HomeController
{
public function index(){
return view('themes.Controller3x1.pages.home');
}
}
11 changes: 11 additions & 0 deletions resources/views/themes/Controller3x1/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "3x1 Controllers Theme",
"ar": "ثري اكس ون كنترولير ثيم",
"description": "3x1 Theme With Controllers Is Default Theme Of 3x1 Framework",
"description_ar": "الثيم الافتراضي لنطاق عمل 3x1",
"keywords": [],
"aliases": "Controller3x1",
"files": [],
"requires": [],
"image": "placeholder.webp"
}
12 changes: 12 additions & 0 deletions resources/views/themes/Controller3x1/layouts/app.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
@include('includes.meta')
@stack('css')
</head>
<body>
@yield('body')

@stack('js')
</body>
</html>
94 changes: 94 additions & 0 deletions resources/views/themes/Controller3x1/pages/home.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>3x1</title>

<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">

<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Nunito', sans-serif;
font-weight: 200;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
}
.title {
font-size: 84px;
}
.links > a {
color: #636b6f;
padding: 0 25px;
font-size: 13px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
</style>
</head>
<body>
<div class="flex-center position-ref full-height">
@if (Route::has('login'))
<div class="top-right links">
@auth
<a href="{{ url('/home') }}">Home</a>
@else
<a href="{{ route('login') }}">Login</a>

@if (Route::has('register'))
<a href="{{ route('register') }}">Register</a>
@endif
@endauth
</div>
@endif

<div class="content">
<div style="width: 50%; display: block; margin-left: auto; margin-right: auto">
</div>
<div class="title">
<img width="200px" src="data:image/svg+xml,%0A%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 89.7 82' style='enable-background:new 0 0 89.7 82;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%23FF007B;%7D .st1%7Bfill:%23022788;%7D%0A%3C/style%3E%3Cg%3E%3Cpolygon class='st0' points='44.9,41 38.8,51.6 0,51.6 0,30.4 38.8,30.4 '/%3E%3Cpolygon id='XMLID_85_' class='st1' points='44.9,41 38.8,51.6 34.3,59.4 21.2,82 0,82 17.5,51.6 23.7,41 17.5,30.4 0,0 21.2,0 34.3,22.6 38.8,30.4 '/%3E%3Cpolygon class='st0' points='68.5,0 47.3,36.9 36.6,18.5 47.3,0 '/%3E%3Cpolygon class='st0' points='68.5,82 47.3,82 36.6,63.5 47.3,45.1 '/%3E%3Crect id='XMLID_48_' x='68.5' y='0' class='st1' width='21.2' height='82'/%3E%3C/g%3E%3C/svg%3E"/>
<br>
3x1 Framework With Controllers
</div>
<p>Full Stack Web Framework Build in Laravel & Craftable</p>
</div>
</div>
</body>
</html>
21 changes: 21 additions & 0 deletions routes/themes/Controller3x1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

use Illuminate\Support\Facades\Route;


/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::middleware(['web'])->group(static function () {
Route::namespace(theme_namespace())->name('theme/')->group(static function() {
Route::get('/', 'HomeController@index')->name('index');
});
});

0 comments on commit 61d7def

Please sign in to comment.