1. Go to this page and download the library: Download angel/core 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/ */
angel / core example snippets
'Angel\Core\CoreServiceProvider'
class PageController extends \Angel\Core\PageController {
public function home()
{
return 'You are home!';
}
}
$table->string('slug')->unique();
protected $slugSeed = 'name';
// app/routes.php
Route::get('products/{slug}', 'ProductController@view');
// app/controllers/ProductController.php
class ProductController extends \Angel\Core\AngelController {
public function view($slug)
{
$Product = App::make('Product');
$this->data['product'] = $Product::where('slug', $slug)->firstOrFail();
return View::make('products.view', $this->data);
}
}
// Adding a new item:
$article = new NewsArticle;
$article->title = Input::get('title');
$article->slug = slug($article, 'title');
$article->save();
// Editing an item:
$article = Article::find(1);
$article->title = Input::get('title');
$article->slug = slug($article, 'title');
$article->save();
$slug = sluggify('String to sluggify!'); // Returns 'string-to-sluggify'