PHP code example of pinkwhalenl / jellyfish

1. Go to this page and download the library: Download pinkwhalenl/jellyfish library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pinkwhalenl / jellyfish example snippets


// Example with published_date.
Jelly::Module('example')->orderBy('published_at','desc')->get();

// example 1.
@foreach(Jelly::Module('articles')->get() as $article)
	<li>{{var_dump($article->data)}}</li>
@endforeach

// example 2.
$content = Jelly::Module('articles')->where('data->slug',$slug)->firstOrFail();

// example 3.
$content = Jelly:Module('articles')->where('data->code','7465')->first();
echo $content->created_at;
echo $content->data->title;

// ExampleController.php
use JellyForms;

public function store(){
    // Validate
    request()->validate([
        'name' => '::put('contact_form',[
        'name' => request()->name,
	'email' => request()->email
    ]);
    
    return redirect()->route('ROUTENAME')->with('alert','success');
}

// Show button is signed in.
@if(JellyAuth::Check())
<ul>
    <li><a href="#">Click here..</a></li>
</ul>
@endif

// Check user is an Admin.
@if(JellyAuth::IsAdmin())
    <li><a href="#">[Admin] - Debtors..</a></li>
@endif

// Get Userdata.
JellyAuth::User()->id // Get unique ID
JellyAuth::User()->name // Get name
JellyAuth::User()->email // Get email


{{Trans::get('home.title')}} // Most basic.
{{Trans::get('home.title','nl')}} // With language.
{{Trans::get('home.title','nl','lorem:10')}} // With language + Lorem Ipsum.
{{Trans::get('home.title',null,'lorem:10')}} // No language.
html
{!! Markdown::convertToHtml($data->data()->content) !!}