Jump to content
MakeWebGames

Basic Engine on Laravel


krballard94

Basic Engine on Laravel  

11 members have voted

  1. 1. Basic Engine on Laravel



Recommended Posts

Because that's the way Eloquent is intended to be used.

However for example, if it would update on each reference... What if you wanted to do more than one adjustment? That could be multiple queries!

So why do more, when less is good?

Ah, I've never used Laravel or Eloquent, hence the confusion. Your thread did spike some interest in Laravel for me. The installation was damn hard. xD

Link to comment
Share on other sites

Ah, I've never used Laravel or Eloquent, hence the confusion. Your thread did spike some interest in Laravel for me. The installation was damn hard. xD

Laravel installation? What was hard about it O_O last I checked all you had to do was

 

laravel new PROJECT_NAME

 

- - - Updated - - -

 

I really do like Laravel, alot! Composer makes the installation really easy, even to bring outside packages.

Composer is ace, it not only handles the packages but also can handle the autoload in which laravel takes advantage of.

Bower is the like for the frontend too.

Link to comment
Share on other sites

Laravel installation? What was hard about it O_O last I checked all you had to do was

 

laravel new PROJECT_NAME

My only guess would be trying to install Homestead on Windows... I'm not using Homestead personally, it seems to much effort to install it.

Link to comment
Share on other sites

My only guess would be trying to install Homestead on Windows... I'm not using Homestead personally, it seems to much effort to install it.

Never used it either, not seen the need for it as it doesn't mirror my server at all anyway...

Link to comment
Share on other sites

  • 3 weeks later...

Just a quick update, I have a fully functional permission based access layer with roles included with an admin side. This is including adding new permissions, roles and users while being able to attach and detach permissions to roles and giving a user a role.

I'm just wondering now what people would like a core features? Remembering it's only an engine and not a game.

Link to comment
Share on other sites

I would like to have a book feature of some sort that can tap into other features/modules. This way if/when it does take off and people develop modules, you won't have to go and edit existing code to get the plugin to work.

Keep in mind in not familiar with laravel at all so I don't know if they have something like this built in. Maybe make some sort of method that is registered automatically like a magic method that you can call in your controller(s) that becomes global. For example like for registration you can add something like:

$this->hook->run->registration("some_method");

And it will search files/controllers for a method called registration_some_method(). I don't know if that will work but maybe you get the idea

Edited by KyleMassacre
Link to comment
Share on other sites

This way if/when it does take off and people develop modules, you won't have to go and edit existing code to get the plugin to work.

I don't know how possible this will ever be, as the view files would need to be edited to add the new links that make users able to use the plugin etc, unless there is a way to setup dynamic view files.

This is probably gonna sound so confusing because well I'm thinking it up on the spot.

Gonna refer to mccodes as most of us know how the files generally look.

Ok, so take the explore.php file from mccodes. When rendered its basically a table split into three columns with a bunch of links in them.

What I'm suggesting is to create a unique identifier for each of these <td></td> 's. Something maybe like this:

<td valign='top' data-view-identifier='explore_top_left'></td>

And not only here on the eplore.php page but say the mainmenu as well, basically anywhere where devs put links to plugins that users can use.

Then each plugin could have a file which stores the links it needs and where to place them, some pseudo code:

Add link to explore_top_left : <a href='link_to_page'>Some Link</a>

All of these types of file are identified and all the links are added to the relevant place on the site.

Has that made any sense?

Link to comment
Share on other sites

Eh, kind of. If what I'm thinking in my head is accurate it may work. Like I said I never used laravel and have only used CI, so if a hook method could be created to loop through these for lack of a better term magic methods I think we can be in business. For example, let's make believe that we have the hooks created to loop through all books like I stated above shall we?:

//I am referencing the way to do it on CI through the controller
$data = array(
   'some_content' => $this->model->some_method(),
   'hooks'        => $this->hook->run->register('some_method')
);
$this->load->view('some_view',$data,true);

Now for the view:

<div><?php echo $hooks; ?></div>
// or instead of looping in the controller for the hook:
<div>
<?php 
foreach($hooks as $hook) {
   echo $hook;
}
</div>

The only thing would be to get module developers to allow for hooks in their controllers and to get the hook class to register the hooks. And also maybe make a property called enabled which accepts a booleon and if it's set to false the hook is disabled.

Link to comment
Share on other sites

Eh, kind of. If what I'm thinking in my head is accurate it may work. Like I said I never used laravel and have only used CI, so if a hook method could be created to loop through these for lack of a better term magic methods I think we can be in business. For example, let's make believe that we have the hooks created to loop through all books like I stated above shall we?:
//I am referencing the way to do it on CI through the controller
$data = array(
   'some_content' => $this->model->some_method(),
   'hooks'        => $this->hook->run->register('some_method')
);
$this->load->view('some_view',$data,true);

Now for the view:

<div><?php echo $hooks; ?></div>
// or instead of looping in the controller for the hook:
<div>
<?php 
foreach($hooks as $hook) {
   echo $hook;
}
</div>

The only thing would be to get module developers to allow for hooks in their controllers and to get the hook class to register the hooks. And also maybe make a property called enabled which accepts a booleon and if it's set to false the hook is disabled.

I'm not entirely sure, so I'll take a look into CodeIgniter's hooks tomorrow..

Link to comment
Share on other sites

I don't believe codeigniter has a hook system. I we just using it as an example because it's the only example of that I can think of off the top of my head.

I see.

At the moment I'm currently implement a more modular structure to the engine. All the core files will end up in the app folder, where as new modifications will end up being in the modules/ModificationName folder

Link to comment
Share on other sites

yeah I like that approach because I think it's easier then to plug mods in. I'll soon be starting work on a nodejs engine, it'll have the same setup. Main setup:

/core/core.route.js - basically the controller

/core/views/filename.view.ejs - view files

/core/model/filename.model.js - game/app logic

Module Set Up:

/module/modulename/modulename.route.js

/module/modulename/views/filename.view.ejs

/module/modulename/model/filename.model.js

It seems a nice way to do it imo

Link to comment
Share on other sites

if the mod name is already used, how will you handle it? generate an extra character or string of characters. or just say there is a conflict?

Just say there is a conflict, although I had to create a whole new validation method for what I needed! (Laravel's unique is database only, where I needed it to check an array!)

Now time to try and sort out to install modules.

Edited by krballard94
Link to comment
Share on other sites

Exactly, and I'm trying to make it create the modification structure via a form while validating the mod name hasn't been used already within the app.

Use namespaces, use composer, make it so authors must register it with composer, then you can just do composer require etc.

Optionally create a new namespace

Modules\Author\Mod

Link to comment
Share on other sites

What I mean, I'm still going to go with the original folder stucture.
modules/
       AuthorOne/
                 ModOne/
                 ModTwo/
       AuthorTwo/
                 ModOne/
       AuthorThree/
                 ModOne/

 

And use the namespace Modules/AuthorOne/ModTwo

Hmm, still possible with composer. But either or :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...